提交 96348c00 authored 作者: Samira Ebrahimi Kahou's avatar Samira Ebrahimi Kahou

fixed merge error

上级 6721995e
...@@ -2713,20 +2713,10 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'): ...@@ -2713,20 +2713,10 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
else: else:
raise ValueError('The string bug_print is not recognised') raise ValueError('The string bug_print is not recognised')
elif hasattr(ops_to_check, '__call__'): # if ops_to_check is a function
apply_nodes_to_check = [node for node in fgraph.apply_nodes
if ops_to_check(node)]
else: # if ops_to_check is an op or a list of ops
raise ValueError('The value of ops_to_check is not supported')
for node in apply_nodes_to_check: for node in apply_nodes_to_check:
for output in node.outputs: for output in node.outputs:
if (not hasattr(output.tag, 'trace') or if (not hasattr(output.tag, 'trace') or
not output.tag.trace): not output.tag.trace):
return False return False
# check if trace is not empty
if not len(output.tag.trace) > 0:
return False
return True return True
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论