提交 765e9a46 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Fixed two standing bugs with my scan save space optimization. These caused the fails in debug mode

上级 89fcb52e
...@@ -167,7 +167,7 @@ class ScanSaveMem(Optimizer): ...@@ -167,7 +167,7 @@ class ScanSaveMem(Optimizer):
# change the number of steps in that case. To do this we set # change the number of steps in that case. To do this we set
# global_nsteps to None which is seen as a flag that nothing needs # global_nsteps to None which is seen as a flag that nothing needs
# to be done # to be done
if len(node.outputs) > c_outs : if len(node.outputs) <= c_outs :
global_nsteps = {'real' :-1, 'sym': []} global_nsteps = {'real' :-1, 'sym': []}
else: else:
global_nsteps = None global_nsteps = None
...@@ -289,7 +289,7 @@ class ScanSaveMem(Optimizer): ...@@ -289,7 +289,7 @@ class ScanSaveMem(Optimizer):
sym_steps = None sym_steps = None
else: else:
sym_steps =global_nsteps['sym'][0] sym_steps =global_nsteps['sym'][0]
for c in global_nsteps['sym'][:1]: for c in global_nsteps['sym'][1:]:
sym_steps = tensor.maximum(sym_steps, c) sym_steps = tensor.maximum(sym_steps, c)
if global_nsteps['real'] >= 0: if global_nsteps['real'] >= 0:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论