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

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

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