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

Fix bug when unpickling previous versions of CAReduce

上级 8632816e
...@@ -1288,7 +1288,7 @@ class CAReduce(Op): ...@@ -1288,7 +1288,7 @@ class CAReduce(Op):
variable = input variable = input
to_reduce = reversed(sorted(axis)) to_reduce = reversed(sorted(axis))
if hasattr(self, 'acc_dtype'): if hasattr(self, 'acc_dtype') and self.acc_dtype is not None:
acc_dtype = self.acc_dtype acc_dtype = self.acc_dtype
else: else:
acc_dtype = node.outputs[0].type.dtype acc_dtype = node.outputs[0].type.dtype
...@@ -1356,7 +1356,7 @@ class CAReduce(Op): ...@@ -1356,7 +1356,7 @@ class CAReduce(Op):
idtype = input.type.dtype_specs()[1] idtype = input.type.dtype_specs()[1]
odtype = output.type.dtype_specs()[1] odtype = output.type.dtype_specs()[1]
if hasattr(self, 'acc_dtype'): if hasattr(self, 'acc_dtype') and self.acc_dtype is not None:
acc_type = TensorType( acc_type = TensorType(
broadcastable=node.outputs[0].broadcastable, broadcastable=node.outputs[0].broadcastable,
dtype=self.acc_dtype) dtype=self.acc_dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论