提交 289075e1 authored 作者: Frederic Bastien's avatar Frederic Bastien

Moved some scan opt to ist own SequentialDB. This uncluter the sequence number.

上级 4b3fce0a
...@@ -125,12 +125,14 @@ def remove_constants_and_unused_inputs_scan(node): ...@@ -125,12 +125,14 @@ def remove_constants_and_unused_inputs_scan(node):
else: else:
return False return False
optdb.register( 'scanOp_remove_constants_and_unused_inputs' scan_seqopt = theano.gof.SequenceDB()
, opt.in2out(remove_constants_and_unused_inputs_scan, optdb.register('scan_seqopt', scan_seqopt, 1.9, 'fast_run', 'scan')
ignore_newtrees = True) scan_seqopt.register('scanOp_remove_constants_and_unused_inputs',
, 1.995 opt.in2out(remove_constants_and_unused_inputs_scan,
, 'fast_run' ignore_newtrees = True),
, 'scan') 5,
'fast_run',
'scan')
class PushOutNonSeqScan(gof.Optimizer): class PushOutNonSeqScan(gof.Optimizer):
...@@ -278,11 +280,11 @@ class PushOutNonSeqScan(gof.Optimizer): ...@@ -278,11 +280,11 @@ class PushOutNonSeqScan(gof.Optimizer):
return False return False
optdb.register('scanOp_pushout_nonseqs_ops', scan_seqopt.register('scanOp_pushout_nonseqs_ops',
PushOutNonSeqScan(), PushOutNonSeqScan(),
1.899, 1,
'fast_run', 'fast_run',
'scan') 'scan')
@gof.local_optimizer([None]) @gof.local_optimizer([None])
...@@ -774,11 +776,11 @@ class ScanSaveMem(gof.Optimizer): ...@@ -774,11 +776,11 @@ class ScanSaveMem(gof.Optimizer):
# Just before specialize to have the other optimization # Just before specialize to have the other optimization
# like constant folding being applied # like constant folding being applied
# This don't introduce inplace. # This don't introduce inplace.
optdb.register( 'scanOp_save_mem' scan_seqopt.register( 'scanOp_save_mem',
, ScanSaveMem() ScanSaveMem(),
, 1.99 4,
, 'fast_run' 'fast_run',
, 'scan') 'scan')
class ScanMerge(gof.Optimizer): class ScanMerge(gof.Optimizer):
...@@ -972,11 +974,11 @@ class ScanMerge(gof.Optimizer): ...@@ -972,11 +974,11 @@ class ScanMerge(gof.Optimizer):
# after const merge but before stabilize so that we can have identity # after const merge but before stabilize so that we can have identity
# for equivalent nodes but we still have the chance to hoist stuff out # for equivalent nodes but we still have the chance to hoist stuff out
# of the scan later. # of the scan later.
optdb.register('scanOp_merge', scan_seqopt.register('scanOp_merge',
ScanMerge(), ScanMerge(),
1.90, 2,
'fast_run', 'fast_run',
'scan') 'scan')
def has_duplicates(l): def has_duplicates(l):
"""returns true if l has any duplicates (according to __eq__).""" """returns true if l has any duplicates (according to __eq__)."""
...@@ -1117,10 +1119,10 @@ def scan_merge_inouts(node): ...@@ -1117,10 +1119,10 @@ def scan_merge_inouts(node):
return na.outer_outputs return na.outer_outputs
optdb.register('scanOp_merge_inouts' scan_seqopt.register('scanOp_merge_inouts',
, opt.in2out(scan_merge_inouts,ignore_newtrees=True) opt.in2out(scan_merge_inouts,ignore_newtrees=True),
, 1.91 3,
, 'fast_run' 'fast_run',
, 'scan') 'scan')
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论