提交 6f97e51d authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #4598 from fvisin/Fix_max

Do not hide errors in max and argmax
...@@ -1399,8 +1399,6 @@ class MaxAndArgmax(Op): ...@@ -1399,8 +1399,6 @@ class MaxAndArgmax(Op):
%(axis_code)s %(axis_code)s
%(max)s = (PyArrayObject*)PyArray_Max(%(x)s, axis, NULL); %(max)s = (PyArrayObject*)PyArray_Max(%(x)s, axis, NULL);
if(%(max)s == NULL){ if(%(max)s == NULL){
PyErr_SetString(PyExc_ValueError,
"MaxAndArgmax, max failed");
%(fail)s; %(fail)s;
} }
if(!PyArray_CheckExact(%(max)s)){ if(!PyArray_CheckExact(%(max)s)){
...@@ -1412,7 +1410,6 @@ class MaxAndArgmax(Op): ...@@ -1412,7 +1410,6 @@ class MaxAndArgmax(Op):
%(argmax)s = (PyArrayObject*)PyArray_ArgMax(%(x)s, axis, NULL); %(argmax)s = (PyArrayObject*)PyArray_ArgMax(%(x)s, axis, NULL);
if(%(argmax)s == NULL){ if(%(argmax)s == NULL){
PyErr_SetString(PyExc_ValueError, "MaxAndArgmax, argmax failed");
Py_CLEAR(%(max)s); Py_CLEAR(%(max)s);
%(fail)s; %(fail)s;
} }
...@@ -1434,7 +1431,7 @@ class MaxAndArgmax(Op): ...@@ -1434,7 +1431,7 @@ class MaxAndArgmax(Op):
return ret % locals() return ret % locals()
def c_code_cache_version(self): def c_code_cache_version(self):
return (3,) return (4,)
def infer_shape(self, node, shapes): def infer_shape(self, node, shapes):
ishape, axis_shape = shapes ishape, axis_shape = shapes
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论