提交 ad67b004 编写于 作者: M Megvii Engine Team 提交者: 黄信达

fix(imperative/dtype): make tensor.dtype instanceof np.dtype

GitOrigin-RevId: fbb6d0439b6d2a133d7d2c2c7d42e0e6d8a8cff2
上级 47d89033
...@@ -675,12 +675,8 @@ PyObject* dtype_mgb2np(mgb::DType dtype) { ...@@ -675,12 +675,8 @@ PyObject* dtype_mgb2np(mgb::DType dtype) {
Py_XINCREF(Py_None); Py_XINCREF(Py_None);
return Py_None; return Py_None;
} }
if (dtype.has_param()) { // NOTE: the following is additional
return reinterpret_cast<PyObject*>(descr.release()); return reinterpret_cast<PyObject*>(descr.release());
}
PyObject* typeobj = reinterpret_cast<PyObject*>(descr->typeobj);
Py_XINCREF(typeobj);
return typeobj;
} }
mgb::DType dtype_np2mgb(PyObject* obj) { mgb::DType dtype_np2mgb(PyObject* obj) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册