diff --git a/imperative/python/src/helper.cpp b/imperative/python/src/helper.cpp index 7f38403b504c6e09753c551867f67fd0a722f07c..ede45bd76f5349accfeb4f229a3f6c098f079066 100644 --- a/imperative/python/src/helper.cpp +++ b/imperative/python/src/helper.cpp @@ -675,12 +675,8 @@ PyObject* dtype_mgb2np(mgb::DType dtype) { Py_XINCREF(Py_None); return Py_None; } - if (dtype.has_param()) { - return reinterpret_cast(descr.release()); - } - PyObject* typeobj = reinterpret_cast(descr->typeobj); - Py_XINCREF(typeobj); - return typeobj; + // NOTE: the following is additional + return reinterpret_cast(descr.release()); } mgb::DType dtype_np2mgb(PyObject* obj) {