提交 11d20a28 authored 作者: Frederic's avatar Frederic

make the Stack vm being used with theano flag linker=vm,vm.lazy=True.

上级 65d5d0bd
...@@ -505,10 +505,11 @@ class VM_Linker(link.LocalLinker): ...@@ -505,10 +505,11 @@ class VM_Linker(link.LocalLinker):
the virtual machine. It will be called with four arguments called the virtual machine. It will be called with four arguments called
'node', 'thunk', 'storage_map', and 'compute_map'. 'node', 'thunk', 'storage_map', and 'compute_map'.
lazy - Useful only when use_cloop is False. When lazy is None, auto lazy - Useful only when use_cloop is False. When lazy is None, use the
theano flag vm.lazy value. Then if we have a None(default) we auto
detect if lazy evaluation is needed and use the apropriate detect if lazy evaluation is needed and use the apropriate
version. If lazy it True/False, force the version used between version. If lazy it is True or False, we force the version used
Loop/LoopGC and Stack. between Loop/LoopGC and Stack.
""" """
if allow_gc is None: if allow_gc is None:
...@@ -712,6 +713,8 @@ class VM_Linker(link.LocalLinker): ...@@ -712,6 +713,8 @@ class VM_Linker(link.LocalLinker):
assert c0 == sys.getrefcount(node_n_inputs) assert c0 == sys.getrefcount(node_n_inputs)
else: else:
lazy = self.lazy lazy = self.lazy
if lazy is None:
lazy = config.vm.lazy
if lazy is None: if lazy is None:
lazy = not all([(not th.lazy) for th in thunks]) lazy = not all([(not th.lazy) for th in thunks])
if not lazy: if not lazy:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论