提交 e78ee94c authored 作者: Roy Xue's avatar Roy Xue

move current and bound check position

remove an unused line
上级 99696ef9
...@@ -751,6 +751,11 @@ class ProfileStats(object): ...@@ -751,6 +751,11 @@ class ProfileStats(object):
mem_created = 0 mem_created = 0
mem_freed = 0 mem_freed = 0
if mem_count > mem_bound:
mem_count -= mem_created
mem_count += mem_freed
continue
for var in node.outputs: for var in node.outputs:
compute_map[var][0] = 1 compute_map[var][0] = 1
...@@ -767,7 +772,6 @@ class ProfileStats(object): ...@@ -767,7 +772,6 @@ class ProfileStats(object):
idx += 1 idx += 1
#add mem_freed, this part is not working well #add mem_freed, this part is not working well
print type(node)
for val in node.inputs: for val in node.inputs:
if (dependencies[val] and val.owner and val not in fgraph.outputs): if (dependencies[val] and val.owner and val not in fgraph.outputs):
if all(compute_map[v] for v in dependencies[val]): if all(compute_map[v] for v in dependencies[val]):
...@@ -777,10 +781,7 @@ class ProfileStats(object): ...@@ -777,10 +781,7 @@ class ProfileStats(object):
mem_count -= mem_freed mem_count -= mem_freed
# check if cut path now # check if cut path now
if mem_count > mem_bound:
mem_count -= mem_created
mem_count += mem_freed
continue
for var in node.outputs: for var in node.outputs:
for c, _ in var.clients: for c, _ in var.clients:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论