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

Merge pull request #3 from nouiz/GSoC2014_part2

Fix max memory counter.
......@@ -667,8 +667,8 @@ class ProfileStats(object):
val = nodes_mem[node]
dmap = getattr(node.op, 'destroy_map', None)
vmap = getattr(node.op, 'view_map', None)
for idx, v in enumerate(val):
idx = 0
for v in val:
# TODO check the op returned a view
if dmap and idx in dmap:
node_memory_saved_by_inplace += v
......@@ -678,6 +678,7 @@ class ProfileStats(object):
elif not isinstance(v, str):
node_memory_size += v
running_memory_size += v
idx += 1
if running_memory_size > running_max_memory_size:
running_max_memory_size = running_memory_size
old_storage = thunk_old_storage[order.index(node)]
......@@ -815,10 +816,12 @@ class ProfileStats(object):
dmap = getattr(node.op, 'destroy_map', None)
vmap = getattr(node.op, 'view_map', None)
for idx, v in enumerate(val):
idx = o
for v in val:
# TODO check the op returned a view
if idx not in dmap and idx not in vmap and not isinstance(v, str):
running_memory_size += v
idx += 1
if running_memory_size > running_max_memory_size:
running_max_memory_size = running_memory_size
old_storage = thunk_old_storage[order.index(node)]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论