提交 fdc79e70 authored 作者: Caglar's avatar Caglar

Fixed the output print of scan.

上级 5c0da463
...@@ -588,7 +588,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False, ...@@ -588,7 +588,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
if len(a.outputs) == 1: if len(a.outputs) == 1:
print >> file, '%s%s %s%s \'%s\' %s %s %s' % (prefix, a.op, print >> file, '%s%s %s%s \'%s\' %s %s %s' % (prefix, a.op,
id_str, id_str,
type_str, r_name, type_str,
r_name,
destroy_map_str, destroy_map_str,
view_map_str, view_map_str,
o) o)
...@@ -605,6 +606,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False, ...@@ -605,6 +606,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
not (hasattr(r, 'name') and r.name is not None)): not (hasattr(r, 'name') and r.name is not None)):
new_prefix = prefix_child + ' |' new_prefix = prefix_child + ' |'
new_prefix_child = prefix_child + ' |' new_prefix_child = prefix_child + ' |'
for idx, i in enumerate(a.inputs): for idx, i in enumerate(a.inputs):
if idx == len(a.inputs) - 1: if idx == len(a.inputs) - 1:
new_prefix_child = prefix_child + ' ' new_prefix_child = prefix_child + ' '
......
...@@ -109,11 +109,26 @@ def debugprint(obj, depth=-1, print_type=False, ...@@ -109,11 +109,26 @@ def debugprint(obj, depth=-1, print_type=False,
file=_file, order=order, ids=ids, file=_file, order=order, ids=ids,
scan_ops=scan_ops, stop_on_name=stop_on_name) scan_ops=scan_ops, stop_on_name=stop_on_name)
new_prefix = ' >'
new_prefix_child = ' >'
print >> file, "\nInner of the scan. "
for s in scan_ops: for s in scan_ops:
debugmode.debugprint(s, depth=depth, done=done, print_type=print_type, debugmode.debugprint(s, depth=depth, done=done, print_type=print_type,
file=_file, order=order, ids=ids, file=_file, order=order, ids=ids,
scan_ops=scan_ops, stop_on_name=stop_on_name) scan_ops=scan_ops, stop_on_name=stop_on_name)
if hasattr(s.owner, 'op') and isinstance(s.owner.op, theano.scan_module.scan_op.Scan):
for idx, i in enumerate(s.owner.op.outputs):
if hasattr(i, 'owner') and hasattr(i.owner, 'op'):
if isinstance(i.owner.op, theano.scan_module.scan_op.Scan):
scan_ops.append(i)
debugmode.debugprint(r=i, prefix=new_prefix, depth=depth, done=done,
print_type=print_type, file=file, order=order,
ids=ids, stop_on_name=stop_on_name,
prefix_child=new_prefix_child, scan_ops=scan_ops)
if file is _file: if file is _file:
return file return file
elif file == 'str': elif file == 'str':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论