提交 17fec661 authored 作者: Iulian Vlad Serban's avatar Iulian Vlad Serban

Fixed Flake8 errors and error in copying stack trace.

上级 30c3ed89
...@@ -3019,8 +3019,6 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'): ...@@ -3019,8 +3019,6 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
if (not hasattr(output.tag, 'trace') or not output.tag.trace): if (not hasattr(output.tag, 'trace') or not output.tag.trace):
print ('Failed on node') print ('Failed on node')
print (node) print (node)
#print(node.outputs[0].tag.trace)
#print(node.tag.trace)
return False return False
return True return True
...@@ -4598,7 +4598,6 @@ def local_fill_cut(node): ...@@ -4598,7 +4598,6 @@ def local_fill_cut(node):
# from the removed fill op, it must come from the elemntwise op. # from the removed fill op, it must come from the elemntwise op.
copy_stack_trace(node.outputs, rval) copy_stack_trace(node.outputs, rval)
if isinstance(rval, gof.Variable): if isinstance(rval, gof.Variable):
return rval.owner.outputs return rval.owner.outputs
else: else:
...@@ -5158,6 +5157,7 @@ def local_sum_prod_mul_by_scalar(node): ...@@ -5158,6 +5157,7 @@ def local_sum_prod_mul_by_scalar(node):
new_op_input_nb_elements = new_op_input.size new_op_input_nb_elements = new_op_input.size
new_op_output = node.op(new_op_input) new_op_output = node.op(new_op_input)
if not len(non_scalars) == 0:
# Copy over stacktrace from previous output to new mul op, # Copy over stacktrace from previous output to new mul op,
# for same reason as above. # for same reason as above.
copy_stack_trace(node.outputs, new_op_output) copy_stack_trace(node.outputs, new_op_output)
...@@ -5186,7 +5186,7 @@ def local_sum_prod_mul_by_scalar(node): ...@@ -5186,7 +5186,7 @@ def local_sum_prod_mul_by_scalar(node):
ret = T.mul(*mul_inputs) ret = T.mul(*mul_inputs)
# Copy over stacktrace from previous output to new mul op, # Copy over stacktrace from previous output to new mul op,
# for same reason as above. # for same reason as above.
copy_stack_trace(node.outputs, [ret]+mul_inputs) copy_stack_trace(node.outputs, [ret] + mul_inputs)
return [ret] return [ret]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论