提交 bf8f180c authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Proper name to flag that checks if savemem opt was applied

上级 22d55c7e
...@@ -609,7 +609,7 @@ def scan(fn, ...@@ -609,7 +609,7 @@ def scan(fn,
info['gpu'] = False info['gpu'] = False
info['as_while'] = as_while info['as_while'] = as_while
info['profile'] = profile info['profile'] = profile
info['_scan_merge_visited'] = True info['_scan_savemem_visited'] = True
local_op = scan_op.Scan(inner_inputs, new_outs, info) local_op = scan_op.Scan(inner_inputs, new_outs, info)
......
...@@ -700,7 +700,7 @@ class ScanSaveMem(gof.Optimizer): ...@@ -700,7 +700,7 @@ class ScanSaveMem(gof.Optimizer):
# 3.6 Compose the new scan # 3.6 Compose the new scan
# I need to make sure I'm not reapplying the same optimization # I need to make sure I'm not reapplying the same optimization
# twice since bad things usually happen if I do that # twice since bad things usually happen if I do that
info['_scan_merge_visited'] = True info['_scan_savemem_visited'] = True
new_outs = scan_op.Scan(inps, new_outs = scan_op.Scan(inps,
outs, outs,
info).make_node(*node_ins).outputs info).make_node(*node_ins).outputs
...@@ -793,7 +793,7 @@ class ScanSaveMem(gof.Optimizer): ...@@ -793,7 +793,7 @@ class ScanSaveMem(gof.Optimizer):
nodelist = [x for x in env.toposort() if isinstance(x.op, nodelist = [x for x in env.toposort() if isinstance(x.op,
scan_op.Scan)] scan_op.Scan)]
for node in nodelist: for node in nodelist:
if not hasattr(node.op, '_scan_merge_visited'): if not hasattr(node.op, '_scan_savemem_visited'):
self.process_node(env, node) self.process_node(env, node)
# Just before specialize to have the other optimization # Just before specialize to have the other optimization
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论