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

add error check

上级 ac12b7c4
...@@ -81,7 +81,7 @@ class DotModulo(Op): ...@@ -81,7 +81,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 """
...@@ -101,6 +101,8 @@ class DotModulo(Op): ...@@ -101,6 +101,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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论