提交 6eae2985 authored 作者: Frederic's avatar Frederic

bug fix. We where freeing too early, as the compute map values are list. If they…

bug fix. We where freeing too early, as the compute map values are list. If they contain any elements they evaluate to true. We want the list element to evaluate to true.
上级 1d221db2
......@@ -740,8 +740,7 @@ class ProfileStats(object):
if (dependencies[ins] and
ins not in fgraph.outputs and
ins.owner and
all(compute_map[v] for v in dependencies[ins])):
all([compute_map[v][0] for v in dependencies[ins]])):
if ins not in view_of and not viewed_by.get(ins, []):
running_memory_size -= var_mem[ins]
elif ins in view_of:
......@@ -873,7 +872,7 @@ class ProfileStats(object):
if (dependencies[ins] and
ins not in fgraph.outputs and
ins.owner and
all(compute_map[v] for v in dependencies[ins])):
all([compute_map[v][0] for v in dependencies[ins]])):
if ins not in view_of_temp and not viewed_by_temp.get(ins, []):
mem_freed += var_mem[ins]
elif ins in view_of_temp:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论