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

Use the same reason as the tag of the optimization.

This allow to easily know how to disable that specific optimization.
上级 f293a0f6
...@@ -289,7 +289,7 @@ class PushOutNonSeqScan(gof.Optimizer): ...@@ -289,7 +289,7 @@ class PushOutNonSeqScan(gof.Optimizer):
fgraph.replace_all_validate_remove( fgraph.replace_all_validate_remove(
zip(node.outputs, nw_node.outputs), zip(node.outputs, nw_node.outputs),
remove=[node], remove=[node],
reason='scan_push_computation_out') reason='scanOp_pushout_nonseqs_ops')
return True return True
elif to_keep == []: elif to_keep == []:
# Nothing in the inner graph should be kept # Nothing in the inner graph should be kept
...@@ -310,7 +310,7 @@ class PushOutNonSeqScan(gof.Optimizer): ...@@ -310,7 +310,7 @@ class PushOutNonSeqScan(gof.Optimizer):
fgraph.replace_all_validate_remove( fgraph.replace_all_validate_remove(
replace_with.items(), replace_with.items(),
remove=[node], remove=[node],
reason='scan_push_computation_out') reason='scanOp_pushout_nonseqs_ops')
else: else:
return False return False
...@@ -478,7 +478,7 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -478,7 +478,7 @@ class PushOutSeqScan(gof.Optimizer):
fgraph.replace_all_validate_remove( fgraph.replace_all_validate_remove(
zip(node.outputs, nw_node.outputs), zip(node.outputs, nw_node.outputs),
remove=[node], remove=[node],
reason='scan_push_computation_out') reason='scanOp_pushout_seqs_ops')
return True return True
elif (to_keep == [] and elif (to_keep == [] and
not op.as_while and not op.as_while and
...@@ -510,7 +510,7 @@ class PushOutSeqScan(gof.Optimizer): ...@@ -510,7 +510,7 @@ class PushOutSeqScan(gof.Optimizer):
fgraph.replace_all_validate_remove( fgraph.replace_all_validate_remove(
replace_with.items(), replace_with.items(),
remove=[node], remove=[node],
reason='scan_push_seq_computation_out') reason='scanOp_pushout_seqs_ops')
else: else:
return False return False
...@@ -568,7 +568,7 @@ class ScanInplaceOptimizer(Optimizer): ...@@ -568,7 +568,7 @@ class ScanInplaceOptimizer(Optimizer):
fgraph.replace_all_validate_remove( fgraph.replace_all_validate_remove(
zip(node.outputs, new_outs), zip(node.outputs, new_outs),
remove=[node], remove=[node],
reason=self.__class__.__name__) reason='scanOp_make_inplace')
op = new_op op = new_op
node = new_outs[0].owner node = new_outs[0].owner
except InconsistencyError, e: except InconsistencyError, e:
...@@ -1042,7 +1042,7 @@ class ScanSaveMem(gof.Optimizer): ...@@ -1042,7 +1042,7 @@ class ScanSaveMem(gof.Optimizer):
remove.append(node) remove.append(node)
fgraph.replace_all_validate_remove(old_new, fgraph.replace_all_validate_remove(old_new,
remove, remove,
reason='scan_save_mem') reason='scanOp_save_mem')
def apply(self, fgraph): def apply(self, fgraph):
...@@ -1230,7 +1230,7 @@ class ScanMerge(gof.Optimizer): ...@@ -1230,7 +1230,7 @@ class ScanMerge(gof.Optimizer):
proposal = self.merge(subset) proposal = self.merge(subset)
fgraph.replace_all_validate_remove(proposal, fgraph.replace_all_validate_remove(proposal,
remove=subset, remove=subset,
reason='scan_merge') reason='scanOp_merge')
def has_duplicates(l): def has_duplicates(l):
...@@ -1594,7 +1594,7 @@ class PushOutDot1(gof.Optimizer): ...@@ -1594,7 +1594,7 @@ class PushOutDot1(gof.Optimizer):
old_new += zip(node.outputs[pos+1:], new_outs[pos:]) old_new += zip(node.outputs[pos+1:], new_outs[pos:])
fgraph.replace_all_validate_remove(old_new, fgraph.replace_all_validate_remove(old_new,
remove = [node], remove = [node],
reason='PushOutDot1') reason='scan_pushout_dot1')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论