提交 d4563178 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix memory leak in scan related to the input and output storage of the inner function.

上级 a7b9a7e8
......@@ -1104,6 +1104,13 @@ class Scan(PureOp):
# little trick that I used
outs[idx][0] = outs[idx][0][:-(n_steps - i)]
# Make sure to release storage if allow_gc is True
if getattr(fn, 'allow_gc', False):
for i in input_storage:
i.storage[0] = None
for o in output_storage:
o.storage[0] = None
t_call = time.time() - t0_call
# NOTE: make this match what's in function_module.Function
# and this little string helps us to find this spot:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论