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

better profiling output

上级 9927b343
...@@ -342,7 +342,7 @@ class ProfileStats(object): ...@@ -342,7 +342,7 @@ class ProfileStats(object):
es += [' %2s '] es += [' %2s ']
hs += ['<#call>'] hs += ['<#call>']
es += [' %4d '] es += [' %5d ']
hs += ['<#apply>'] hs += ['<#apply>']
es += [' %4d '] es += [' %4d ']
...@@ -362,9 +362,12 @@ class ProfileStats(object): ...@@ -362,9 +362,12 @@ class ProfileStats(object):
continue continue
tot += t tot += t
ftot = tot * 100 / local_time ftot = tot * 100 / local_time
# Remove the useless start and end of the class name:
# "<class 'theano.sandbox.cuda.blas.GpuDot22'>" -> "theano.sandbox.cuda.blas.GpuDot22"
class_name = str(a)[8:-2][:maxlen]
print >> file, format_str % (f, ftot, t, t / nb_call, print >> file, format_str % (f, ftot, t, t / nb_call,
impl, nb_call, impl, nb_call,
nb_apply, str(a)[:maxlen]) nb_apply, class_name)
# While this carries over less information, it is arranged such # While this carries over less information, it is arranged such
# that it way more readeable that the previous output of the # that it way more readeable that the previous output of the
# profiler # profiler
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论