提交 71f0090e authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Same change in sequence optimization

上级 35381fc1
...@@ -436,7 +436,11 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -436,7 +436,11 @@ class PushOutSeqScan(gof.Optimizer):
for nd in existent_nodes: for nd in existent_nodes:
to_keep += nd.inputs to_keep += nd.inputs
for idx, out in enumerate(to_replace): for idx, out in enumerate(to_replace):
if out in to_keep and out.owner not in existent_nodes: if (out in to_keep
and out.owner not in existent_nodes
# If types are different, conversion Op will be inserted,
# and it may trigger an infinite loop.
and replace_with_in[idx].type == out.type):
clean_to_replace += [out] clean_to_replace += [out]
clean_replace_with_in += [replace_with_in[idx]] clean_replace_with_in += [replace_with_in[idx]]
clean_replace_with_out += [replace_with_out[idx]] clean_replace_with_out += [replace_with_out[idx]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论