提交 f79cb1c4 authored 作者: Frederic's avatar Frederic

Fix handling of test_value when the size is 0 in an optimization.

上级 545326f8
...@@ -4656,6 +4656,8 @@ def local_elemwise_fusion_op(OP, max_input_fct=lambda node: 1024): ...@@ -4656,6 +4656,8 @@ def local_elemwise_fusion_op(OP, max_input_fct=lambda node: 1024):
else: else:
s = scalar.Scalar(i.dtype).make_variable() s = scalar.Scalar(i.dtype).make_variable()
try: try:
v = gof.op.get_test_value(i)
if v.size > 0:
s.tag.test_value = gof.op.get_test_value(i).flatten()[0] s.tag.test_value = gof.op.get_test_value(i).flatten()[0]
except AttributeError: except AttributeError:
pass pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论