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

Add assert about shape with test_value and return True as in the the other cases.

The return value isn't used in this case, but consistency is good.
上级 b16c4fda
...@@ -429,6 +429,11 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -429,6 +429,11 @@ class PushOutSeqScan(gof.Optimizer):
to_replace += [y] to_replace += [y]
replace_with_in += [y_place_holder] replace_with_in += [y_place_holder]
replace_with_out += [new_outer] replace_with_out += [new_outer]
if hasattr(new_outer.tag, "test_value"):
new_sh = new_outer.tag.test_value.shape
ref_sh = (outside_ins.tag.test_value.shape[0],)
ref_sh += nd.outputs[0].tag.test_value.shape
assert new_sh == ref_sh
changed = True changed = True
if counts >= max_iterations: if counts >= max_iterations:
...@@ -522,7 +527,7 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -522,7 +527,7 @@ class PushOutSeqScan(gof.Optimizer):
replace_with.items(), replace_with.items(),
remove=[node], remove=[node],
reason='scanOp_pushout_seqs_ops') reason='scanOp_pushout_seqs_ops')
return True
else: else:
return False return False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论