提交 a45a4692 authored 作者: Frederic's avatar Frederic

fix a printed profiler information and rename a variable.

上级 7ea29681
...@@ -776,7 +776,7 @@ class ProfileStats(object): ...@@ -776,7 +776,7 @@ class ProfileStats(object):
if size_sum_dense == 0: if size_sum_dense == 0:
p = "0%" p = "0%"
else: else:
p = "(%.2f%%)" % (sum_remaining / size_sum_dense * 100) p = "(%.2f%%)" % (float(sum_remaining) / size_sum_dense * 100)
print >> file, ( print >> file, (
' ... (remaining %i Apply account for %4dB/%dB (%s) of' ' ... (remaining %i Apply account for %4dB/%dB (%s) of'
' the Apply with dense outputs sizes)') % (max(0, len(node_mem) - N), ' the Apply with dense outputs sizes)') % (max(0, len(node_mem) - N),
...@@ -793,18 +793,18 @@ class ProfileStats(object): ...@@ -793,18 +793,18 @@ class ProfileStats(object):
print >> file, '' print >> file, ''
def summary(self, file=sys.stderr, n_ops_to_print=20, def summary(self, file=sys.stderr, n_ops_to_print=20,
n_applies_to_print=20): n_apply_to_print=20):
self.summary_function(file) self.summary_function(file)
local_time = sum(self.apply_time.values()) local_time = sum(self.apply_time.values())
if local_time > 0: if local_time > 0:
self.summary_class(file, n_ops_to_print) self.summary_class(file, n_ops_to_print)
self.summary_ops(file, n_ops_to_print) self.summary_ops(file, n_ops_to_print)
self.summary_nodes(file, n_applies_to_print) self.summary_nodes(file, n_apply_to_print)
elif self.fct_callcount > 0: elif self.fct_callcount > 0:
print >> file, (" No execution time accumulated " print >> file, (" No execution time accumulated "
"(hint: try config profiling.time_thunks=1)") "(hint: try config profiling.time_thunks=1)")
if config.profile_memory: if config.profile_memory:
self.summary_memory(file, n_ops_to_print) self.summary_memory(file, n_apply_to_print)
if self.optimizer_profile: if self.optimizer_profile:
print "Optimizer Profile" print "Optimizer Profile"
print "-----------------" print "-----------------"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论