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

fix a bug in DebugMode when their is only c_code(no perform()) and that we do…

fix a bug in DebugMode when their is only c_code(no perform()) and that we do inplace operation on the inputs. This would cause False error warning.
上级 460debbf
...@@ -1095,10 +1095,13 @@ class _Linker(gof.link.LocalLinker): ...@@ -1095,10 +1095,13 @@ class _Linker(gof.link.LocalLinker):
if thunk_c: if thunk_c:
clobber = True
if thunk_py:
for r in node.inputs: for r in node.inputs:
# TODO: we only need to overwrite the non-destroyed inputs # TODO: we only need to overwrite the non-destroyed inputs
# print >> sys.stderr, i, "DEBUGMODE replacing input", r # print >> sys.stderr, i, "DEBUGMODE replacing input", r
storage_map[r][0] = _lessbroken_deepcopy(r_vals[r]) storage_map[r][0] = _lessbroken_deepcopy(r_vals[r])
clobber = False
debug(i, "DEBUGMODE running thunk_c") debug(i, "DEBUGMODE running thunk_c")
try: try:
...@@ -1118,7 +1121,7 @@ class _Linker(gof.link.LocalLinker): ...@@ -1118,7 +1121,7 @@ class _Linker(gof.link.LocalLinker):
self.maker.mode.require_matching_strides, node.op) self.maker.mode.require_matching_strides, node.op)
_check_inputs(node, storage_map, r_vals, dr_vals, active_order_set, _check_inputs(node, storage_map, r_vals, dr_vals, active_order_set,
clobber_dr_vals=False, perform='c') clobber_dr_vals=clobber, perform='c')
_check_viewmap(node, storage_map) _check_viewmap(node, storage_map)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论