mbrookhart commented on a change in pull request #5680:
URL: https://github.com/apache/incubator-tvm/pull/5680#discussion_r431240142
##########
File path: tests/python/relay/test_dataflow_pattern.py
##########
@@ -1033,6 +1033,18 @@ def conv_bias_relu(x, w, b):
assert pattern2.match(relu)
assert tvm.ir.structural_equal(func(x, w, b), pattern2.partition(relu))
+def test_match_match():
+ add_pattern = is_op('add')(wildcard(), wildcard())
+ class TestRewrite(DFPatternCallback):
+ def __init__(self):
+ self.pattern = add_pattern
+ def callback(self, pre, post, node_map):
+ return post.args[0] - post.args[1]
+ mod = tvm.IRModule({})
+ tvm.relay.prelude.Prelude(mod)
+ # Apply rewrite on IR including relay.Match
+ rewrite(TestRewrite(), mod['tensor_concatenate_int64'])
Review comment:
Can you add an assert on the output of this? I understand the goal is to
write something that will catch a rewrite overflow, but I'd prefer to check the
output as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]