提交 e6724e8d authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #4383 from saebrahimi/keep_stack_trace_tensor_tests/test_opt

Make stack trace tests in `tensor/tests/test_opt.py` use `check_stack_trace`.
......@@ -2667,7 +2667,8 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
# if ops_to_check is a string
if isinstance(ops_to_check, string_types):
if ops_to_check == 'last':
apply_nodes_to_check = [fgraph.outputs[0].owner]
apply_nodes_to_check = [fgraph.outputs[i].owner for i in range(
len(fgraph.outputs))]
elif ops_to_check == 'all':
apply_nodes_to_check = fgraph.apply_nodes
else:
......@@ -2714,8 +2715,7 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
for node in apply_nodes_to_check:
for output in node.outputs:
if (not hasattr(output.tag, 'trace') or
not output.tag.trace):
if (not hasattr(output.tag, 'trace') or not output.tag.trace):
return False
return True
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论