提交 27de245b authored 作者: Melanie Ducoffe's avatar Melanie Ducoffe

change the c code of AllocEmpty

上级 1895146c
...@@ -5521,7 +5521,7 @@ class AllocEmpty(gof.Op): ...@@ -5521,7 +5521,7 @@ class AllocEmpty(gof.Op):
for idx, sh in enumerate(shps): for idx, sh in enumerate(shps):
str +="dims[%(idx)s] =" \ str +="dims[%(idx)s] =" \
"((npy_intp) PyLong_AsLong((PyObject*)%(sh)s));\n" % locals() "((npy_intp)((dtype_%(sh)s*)PyArray_DATA(%(sh)s))[0]);\n" % locals()
# Validate that the output storage exists # Validate that the output storage exists
str += "if(%(out)s==NULL\n" % locals() str += "if(%(out)s==NULL\n" % locals()
...@@ -5550,6 +5550,7 @@ class AllocEmpty(gof.Op): ...@@ -5550,6 +5550,7 @@ class AllocEmpty(gof.Op):
return [node.inputs] return [node.inputs]
def c_code_cache_version(self): def c_code_cache_version(self):
return None
return (2,) return (2,)
def do_constant_folding(self, node): def do_constant_folding(self, node):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论