提交 8da30f6e authored 作者: Frederic's avatar Frederic

In debugprint, don't print the profile headers more then once and only add it if…

In debugprint, don't print the profile headers more then once and only add it if the profile isn't empty.
上级 19ccd72c
......@@ -132,14 +132,8 @@ def debugprint(obj, depth=-1, print_type=False,
obj)
scan_ops = []
for r, p in zip(results_to_print, profile_list):
# Add the parent scan op to the list as well
if (hasattr(r.owner, 'op') and
isinstance(r.owner.op, theano.scan_module.scan_op.Scan)):
scan_ops.append(r)
if p is not None:
print("""
if any([p for p in profile_list if p is not None and p.fct_callcount > 0]):
print("""
Timing Info
-----------
--> <time> <% time> - <total time> <% total time>'
......@@ -157,6 +151,12 @@ N.B.:
to remove when optimizing a graph because their <total time> is very low.
""", file=_file)
for r, p in zip(results_to_print, profile_list):
# Add the parent scan op to the list as well
if (hasattr(r.owner, 'op') and
isinstance(r.owner.op, theano.scan_module.scan_op.Scan)):
scan_ops.append(r)
debugmode.debugprint(r, depth=depth, done=done, print_type=print_type,
file=_file, order=order, ids=ids,
scan_ops=scan_ops, stop_on_name=stop_on_name,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论