提交 c46d30be authored 作者: Frederic Bastien's avatar Frederic Bastien

Code clean up and more readable printing

上级 5170ff7b
......@@ -1154,24 +1154,18 @@ class ProfileStats(object):
print("(For values in brackets, it's for linker = c|py", file=file)
def print_stats(stats1, stats2):
(max_node_memory_size,
max_running_max_memory_size,
max_node_memory_saved_by_view,
max_node_memory_saved_by_inplace) = stats1
(new_max_node_memory_size,
new_max_running_max_memory_size,
new_max_node_memory_saved_by_view,
new_max_node_memory_saved_by_inplace) = stats2
print(" CPU + GPU: %dKB (%dKB)" % (int(round(
new_max_running_max_memory_size[0] / 1024.)), int(round(
max_running_max_memory_size[0] / 1024.))), file=file)
print(" CPU: %dKB (%dKB)" % ((int(round(
(_, max_running_max_memory_size, _, _) = stats1
(_, new_max_running_max_memory_size, _, _) = stats2
print(" CPU: %dKB (%dKB)" % ((int(round(
new_max_running_max_memory_size[1] / 1024.)), int(round(
max_running_max_memory_size[1] / 1024.)))), file=file)
print(" GPU: %dKB (%dKB)" % ((int(round(
print(" GPU: %dKB (%dKB)" % ((int(round(
new_max_running_max_memory_size[2] / 1024.)), int(round(
max_running_max_memory_size[2] / 1024.)))), file=file)
print(" CPU + GPU: %dKB (%dKB)" % (int(round(
new_max_running_max_memory_size[0] / 1024.)), int(round(
max_running_max_memory_size[0] / 1024.))), file=file)
print("---", file=file)
print(" Max peak memory with current setting", file=file)
......@@ -1182,12 +1176,12 @@ class ProfileStats(object):
(max_node_memory_size, _, _, _) = stats[0]
(new_max_node_memory_size, _, _, _) = stats[2]
print(" Max peak memory if allow_gc=False (linker don't make a difference)", file=file)
print(" CPU + GPU: %dKB" % int(round(
new_max_node_memory_size[0] / 1024.)), file=file)
print(" CPU: %dKB" % int(round(
print(" CPU: %dKB" % int(round(
new_max_node_memory_size[1] / 1024.)), file=file)
print(" GPU: %dKB" % int(round(
print(" GPU: %dKB" % int(round(
new_max_node_memory_size[2] / 1024.)), file=file)
print(" CPU + GPU: %dKB" % int(round(
new_max_node_memory_size[0] / 1024.)), file=file)
print("---", file=file)
if min_max_peak:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论