Browse Source

fix(mge): fix mem leak of numpy method of DeviceTensorND

GitOrigin-RevId: 06082145f6
release-1.10
Megvii Engine Team 3 years ago
parent
commit
c76e80bc8e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      imperative/python/src/common.cpp

+ 1
- 1
imperative/python/src/common.cpp View File

@@ -142,7 +142,7 @@ void init_common(py::module m) {
.def("numpy", [](const DeviceTensorND& self) {
HostTensorND hv;
hv.copy_from(self).sync();
return py::handle(
return py::reinterpret_steal<py::object>(
npy::ndarray_from_tensor(hv, npy::ShareType::TRY_SHARE));
});



Loading…
Cancel
Save