提交 5f4a202d authored 作者: Frederic Bastien's avatar Frederic Bastien

In DebugMode, preemptive modif in case some op check if they have been applied…

In DebugMode, preemptive modif in case some op check if they have been applied in the Compute_map when their thunk is executed.
上级 8f75cba4
......@@ -1228,13 +1228,26 @@ class _Linker(gof.link.LocalLinker):
storage_map,
compute_map,
no_recycling)
# Right now there is no op that when called check if
# its ouputs are computed and don't recompute itself.
# I think it is not a good idea to do so as we only
# call thunk when we want them computed. So those
# check would be useless. In case some ops do it at
# some point, we reset the compute_map of outputs to
# False.
def wrap_thunk():
for k in node.outputs:
compute_map[k] = [False]
thunk()
if thunks_py[-1] is None:
thunks_py[-1] = thunk
thunks_py[-1] = wrap_thunk
elif thunks_c[-1] is None:
thunks_c[-1] = thunk
thunks_c[-1] = wrap_thunk
else:
_logger.warn("We won't check the perform function of node '%s' but we will check its make_thunk function"%node)
thunks_py[-1] = thunk
thunks_py[-1] = wrap_thunk
if no_recycling is True:
no_recycling = storage_map.values()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论