def free(self):
"""
When allow_gc = False, clear the Variables in storage_map
"""
# 1.no allow_gc return False
# 2.has allow_gc, if allow_gc is False, return True
if not getattr(self.fn, 'allow_gc', True):
for key in self.fn.storage_map:
if not isinstance(key, theano.gof.Constant):
self.fn.storage_map[key][0] = None
for node in self.nodes_with_inner_function:
ops_with_inner_function[node.op].free()
评论列表
文章目录