提交 8babd051 authored 作者: Yann N. Dauphin's avatar Yann N. Dauphin

add error check

上级 5575321e
...@@ -83,7 +83,7 @@ class DotModulo(Op): ...@@ -83,7 +83,7 @@ class DotModulo(Op):
out[0] = matVecModM(A, s, m) out[0] = matVecModM(A, s, m)
def c_code_cache_version(self): def c_code_cache_version(self):
return (3,) return (5,)
def c_code(self, node, name, (_A, _s, _m), (_z, ), sub): def c_code(self, node, name, (_A, _s, _m), (_z, ), sub):
return """ return """
...@@ -103,6 +103,8 @@ class DotModulo(Op): ...@@ -103,6 +103,8 @@ class DotModulo(Op):
%(_z)s = (PyArrayObject*) PyArray_SimpleNew(1, dims, PyArray_TYPE(%(_s)s)); %(_z)s = (PyArrayObject*) PyArray_SimpleNew(1, dims, PyArray_TYPE(%(_s)s));
} }
if(!%(_z)s){%(fail)s;}
{ //makes it compile even though labels jump over variable definitions. { //makes it compile even though labels jump over variable definitions.
// A has size MxN, s has N, output M // A has size MxN, s has N, output M
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论