提交 141a11a7 authored 作者: Pierre Luc Carrier's avatar Pierre Luc Carrier

Added a print of the shapes of the inputs in case of an error.

上级 013aacbc
...@@ -560,7 +560,7 @@ C code. ...@@ -560,7 +560,7 @@ C code.
return gof.Apply(self, [x, y], [output_var]) return gof.Apply(self, [x, y], [output_var])
def c_code_cache_version(self): def c_code_cache_version(self):
return (1, 0, 1) return (1, 0, 2)
def c_support_code(self): def c_support_code(self):
c_support_code = """ c_support_code = """
...@@ -611,7 +611,10 @@ C code. ...@@ -611,7 +611,10 @@ C code.
// Validate that the inputs have the same shape // Validate that the inputs have the same shape
if ( !vector_same_shape(%(x)s, %(y)s)) if ( !vector_same_shape(%(x)s, %(y)s))
{ {
PyErr_Format(PyExc_ValueError, "x.shape[0] != y.shape[0]"); PyErr_Format(PyExc_ValueError, "Shape mismatch : "
"x.shape[0] and y.shape[0] should match but "
"x.shape[0] == %%i and y.shape[0] == %%i",
PyArray_DIMS(%(x)s)[0], PyArray_DIMS(%(y)s)[0]);
%(fail)s; %(fail)s;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论