提交 bf093ee2 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix a bug in CAReduce (that also affected Sum, etc.), in the case where axis==[].

上级 652c8540
...@@ -842,7 +842,7 @@ class CAReduce(Op): ...@@ -842,7 +842,7 @@ class CAReduce(Op):
if axis is None: if axis is None:
axis = range(len(input.type.broadcastable)) axis = range(len(input.type.broadcastable))
if axis == (): if len(axis) == 0:
op = Elemwise(scalar.identity) op = Elemwise(scalar.identity)
return op._c_all(op.make_node(input), name, inames, onames, sub) return op._c_all(op.make_node(input), name, inames, onames, sub)
...@@ -901,7 +901,7 @@ class CAReduce(Op): ...@@ -901,7 +901,7 @@ class CAReduce(Op):
return code return code
def c_code_cache_version_apply(self, node): def c_code_cache_version_apply(self, node):
version = [2] # the version corresponding to the c code in this Op version = [3] # the version corresponding to the c code in this Op
# now we insert versions for the ops on which we depend... # now we insert versions for the ops on which we depend...
scalar_node = Apply(self.scalar_op, scalar_node = Apply(self.scalar_op,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论