diff --git a/imperative/python/src/common.cpp b/imperative/python/src/common.cpp index 6947625d..5f0d1ffe 100644 --- a/imperative/python/src/common.cpp +++ b/imperative/python/src/common.cpp @@ -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( npy::ndarray_from_tensor(hv, npy::ShareType::TRY_SHARE)); });