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

fix(imperative/dtype): fix is_dtype_equal

GitOrigin-RevId: b097c9c3ca55806f5149d2ff3f2c444ba4a32849
上级 0035efa6
......@@ -91,9 +91,8 @@ bool _is_dtype_equal(PyArray_Descr* dt1, PyArray_Descr* dt2) {
PyDict_GetItemString(dt1->metadata, "mgb_dtype"), "zero_point");
PyObject* zp2 = PyDict_GetItemString(
PyDict_GetItemString(dt2->metadata, "mgb_dtype"), "zero_point");
if (!zp1 || !zp2) {
throw py::key_error("zero_point");
}
if (!zp1 && !zp2) return true;
if (!zp1 || !zp2) return false;
return PyLong_AsLong(zp1) == PyLong_AsLong(zp2);
}
if (!q1 && !q2) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册