提交 56a71e79 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix cache version for CAReduce

Fix CAReduce.c_code_cache_version_apply Calling `append` on a tuple raised AttributeError, which was mistaken for a missing `c_code...` function altogether, and the version was ignored.
上级 556627a1
......@@ -1412,11 +1412,8 @@ class CLinker(link.Linker):
version = []
for node_pos, node in enumerate(order):
try:
# Pure Ops do not have a c_code_cache_version_apply ...
if hasattr(node.op, 'c_code_cache_version_apply'):
version.append(node.op.c_code_cache_version_apply(node))
except AttributeError:
pass
for i in node.inputs:
version.append(i.type.c_code_cache_version())
for o in node.outputs:
......
......@@ -1557,7 +1557,8 @@ class AND(BinaryBitOp):
return "%(z)s = (%(x)s & %(y)s);" % locals()
def c_code_cache_version(self):
return (2,1,)
super_version = super(AND, self).c_code_cache_version()
return super_version + (3,)
and_ = AND()
......
......@@ -1623,7 +1623,8 @@ for(int i=0;i<PyArray_NDIM(%(iname)s);i++){
return ['<vector>', '<algorithm>']
def c_code_cache_version_apply(self, node):
version = (6,) # the version corresponding to the c code in this Op
# the version corresponding to the c code in this Op
version = [6]
# now we insert versions for the ops on which we depend...
scalar_node = Apply(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论