提交 3a9aa1eb authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1383 from lamblin/fix_scan_gpu_loop

Fix scan gpu loop
......@@ -250,7 +250,11 @@ class PushOutNonSeqScan(gof.Optimizer):
for nd in existent_nodes:
to_keep += nd.inputs
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_replace_with_in += [replace_with_in[idx]]
clean_replace_with_out += [replace_with_out[idx]]
......@@ -432,7 +436,11 @@ class PushOutSeqScan(gof.Optimizer):
for nd in existent_nodes:
to_keep += nd.inputs
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_replace_with_in += [replace_with_in[idx]]
clean_replace_with_out += [replace_with_out[idx]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论