提交 91224f1e authored 作者: Mohammad Pezeshki's avatar Mohammad Pezeshki 提交者: Pascal Lamblin

copy and check stack trace

上级 d4126ac2
......@@ -4195,7 +4195,10 @@ def local_useless_reshape(node):
index = index + 1
if index != output.ndim:
inner = op.__class__(len(new_output_shape))(input, new_output_shape)
return [DimShuffle(inner.type.broadcastable, dimshuffle_new_order)(inner)]
copy_stack_trace(output, inner)
new_node = [DimShuffle(inner.type.broadcastable, dimshuffle_new_order)(inner)]
copy_stack_trace(output, new_node)
return new_node
@register_canonicalize
......
......@@ -6202,6 +6202,7 @@ class Test_local_useless_reshape(unittest.TestCase):
# Check stacktrace was copied over correctly after opt was applied
self.assertTrue(hasattr(g.outputs[0].tag, 'trace'))
check_stack_trace(g, ops_to_check=(T.DimShuffle, T.Reshape))
def test_local_reshape_lift():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论