提交 5a86d812 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

removed the memory used by a temp variable tmp after I re-arange an array of values

上级 6d6cd33c
......@@ -571,6 +571,7 @@ class Scan(Op):
tmp[:] = outs[idx][0][:pdx]
outs[idx][0][:store_steps[idx]-pdx] = outs[idx][0][pdx:]
outs[idx][0][store_steps[idx]-pdx:] = tmp
del tmp
else:
shape = (store_steps[idx]-pdx,) + outs[idx][0].shape[1:]
if cuda.cuda_available and isinstance( outs[idx][0],
......@@ -581,6 +582,7 @@ class Scan(Op):
tmp[:] = outs[idx][0][pdx:]
outs[idx][0][store_steps[idx]-pdx:] = outs[idx][0][:pdx]
outs[idx][0][:store_steps[idx]-pdx] = tmp
del tmp
for idx,val in enumerate(self.mask):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论