提交 c696d1c9 authored 作者: carriepl's avatar carriepl

Avoid nedlessly reconstructing the inner graph in PushOutSeqScan and PushOutNonSeqScan

上级 6c63d25c
...@@ -361,11 +361,9 @@ class PushOutNonSeqScan(gof.Optimizer): ...@@ -361,11 +361,9 @@ class PushOutNonSeqScan(gof.Optimizer):
nw_outer.append(repl_out) nw_outer.append(repl_out)
givens[to_repl] = repl_in givens[to_repl] = repl_in
_op_outs = scan_utils.clone(clean_outputs, op_outs = scan_utils.clone(clean_outputs, replace=givens)
replace=givens) op_ins = clean_inputs + nw_inner
_op_ins = clean_inputs + nw_inner
op_ins, op_outs = scan_utils.reconstruct_graph(_op_ins, _op_outs)
# Reconstruct node # Reconstruct node
nwScan = scan_op.Scan(op_ins, op_outs, op.info) nwScan = scan_op.Scan(op_ins, op_outs, op.info)
...@@ -610,10 +608,9 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -610,10 +608,9 @@ class PushOutSeqScan(gof.Optimizer):
givens[to_repl] = repl_in givens[to_repl] = repl_in
_op_outs = scan_utils.clone(clean_outputs, op_outs = scan_utils.clone(clean_outputs, replace=givens)
replace=givens) op_ins = nw_inner + clean_inputs
_op_ins = nw_inner + clean_inputs
op_ins, op_outs = scan_utils.reconstruct_graph(_op_ins, _op_outs)
# Reconstruct node # Reconstruct node
nw_info = op.info.copy() nw_info = op.info.copy()
nw_info['n_seqs'] += len(nw_inner) nw_info['n_seqs'] += len(nw_inner)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论