提交 c0e407c0 authored 作者: Frederic Bastien's avatar Frederic Bastien

Code clean up

上级 532dfb3a
......@@ -1516,13 +1516,6 @@ class ScanSaveMem(gof.Optimizer):
node_ins]
node_ins = pre_constant_merge(node_ins)
# 3.6 Compose the new scan
# I need to make sure I'm not reapplying the same optimization
# twice since bad things usually happen if I do that
# TODO: why not check if save mem was done on any of merged nodes?
# That way, if none of them had save mem applied, it would
# be applied later.
info['_scan_savemem_visited'] = True
# TODO: currently we don't support scan with 0 step. So
# don't create one.
if theano.tensor.extract_constant(node_ins[0]) == 0:
......@@ -1627,7 +1620,6 @@ class ScanSaveMem(gof.Optimizer):
nodelist = [x for x in fgraph.toposort() if isinstance(x.op,
scan_op.Scan)]
for node in nodelist:
if not hasattr(node.op, '_scan_savemem_visited'):
self.process_node(fgraph, node)
......@@ -2264,6 +2256,7 @@ optdb.register('scan_eqopt1', scan_eqopt1, .05, 'fast_run', 'scan')
# We run before blas opt at 1.7 and specialize 2.0
# but after stabilize at 1.5. Should we put it before stabilize?
optdb.register('scan_eqopt2', scan_eqopt2, 1.6, 'fast_run', 'scan')
# ScanSaveMem should execute only once per node.
optdb.register('scanOp_save_mem', ScanSaveMem(), 1.61, 'fast_run', 'scan')
optdb.register('scanOp_make_inplace',
ScanInplaceOptimizer(typeInfer=None,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论