提交 d2ee7a06 authored 作者: James Bergstra's avatar James Bergstra

ENH: post-call allow_gc cleanup in vm.Stack

上级 3c6281d1
...@@ -403,6 +403,15 @@ class Stack(VM): ...@@ -403,6 +403,15 @@ class Stack(VM):
if empty_storage_map: if empty_storage_map:
storage_map[i][0] = None storage_map[i][0] = None
# Hacky coarse gc final pass
# This is required until we have a proper gc algorithm for graphs with
# lazy evaluation. See discussion on theano-dev June 19 2012.
if self.allow_gc:
for v in storage_map:
if v.owner and 'output' not in zip(*v.clients)[0]:
storage_map[v][0] = None
compute_map[v][0] = 0
try: try:
import lazylinker_c import lazylinker_c
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论