提交 91534e4a authored 作者: Frederic's avatar Frederic

Fix compilation crash instroduced in gh-1673 on 32 bit python.

上级 082fa2c2
...@@ -1472,11 +1472,19 @@ class MaxAndArgmax(Op): ...@@ -1472,11 +1472,19 @@ class MaxAndArgmax(Op):
%(fail)s; %(fail)s;
} }
} }
if(PyArray_TYPE(%(argmax)s) != NPY_INT64){
PyObject * tmp = PyArray_Cast(%(argmax)s, NPY_INT64);
if (NULL == tmp){
%(fail)s;
}
Py_DECREF(%(argmax)s);
%(argmax)s = (PyArrayObject*)tmp;
}
""" """
return ret % locals() return ret % locals()
def c_code_cache_version(self): def c_code_cache_version(self):
return (1,) return (2,)
def infer_shape(self, node, shapes): def infer_shape(self, node, shapes):
ishape, axis_shape = shapes ishape, axis_shape = shapes
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论