提交 c76e80bc 编写于 作者: M Megvii Engine Team

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

GitOrigin-RevId: 06082145f6f6eff2cf5d7783a3b0ad021bee721d
上级 f96429c0
......@@ -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));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册