提交 3da5407b authored 作者: --global's avatar --global

Remove condition that could cause aliasing and fix typo

上级 a3a49a80
......@@ -1228,7 +1228,7 @@ class ScanSaveMem(gof.Optimizer):
if start == 0 or store_steps[i] == 0:
store_steps[i] = 0
else:
# The "+ 1" is because if the memory pre-allocation
# The "+ 1" is because of the memory pre-allocation
# mechanism used to in the Scan op to reduce overhead.
# To prevent aliasing between the inputs and outputs
# of recurrent states, it requires that the buffer be
......@@ -1236,18 +1236,12 @@ class ScanSaveMem(gof.Optimizer):
# tap needed don't occupy the sample place in the
# circular buffer. For now, this only needs to be done
# for mitsots and sitsots (because mitmots are not
# currently supported by the mechanism) and only if
# the inner function has more then one output
# (otherwise, there is no risk of aliasing because
# once the output is computed, the oldest tap can
# safely be overwritten).
# currently supported by the mechanism).
first_mitsot_idx = node.op.n_mit_mot
last_sitsot_idx = (node.op.n_mit_mot +
node.op.n_mit_sot +
node.op.n_sit_sot - 1)
if (i >= first_mitsot_idx and i <= last_sitsot_idx and
len(node.op.outputs) > 1):
if (i >= first_mitsot_idx and i <= last_sitsot_idx):
pval = select_max(nw_steps - start + init_l[i],
init_l[i] + 1)
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论