As per the comments here : https://github.com/apache/tvm/blob/main/python/tvm/relay/dataflow_pattern/init.py#L824-L842
pre
should be the matching expression in the original graph and
post
should be the matching expression in the rewritten graph
I create a pattern that matches on “const + const” and the rewrite folds them into the result, and then call the routine on the expr " (1 + 2) + 4".
For the first match ( “1 + 2” ), I expect pre
and post
to be the same and that is what I get (i.e. I get “1 + 2” for both). The callback routine will return a “3” for that.
But then for the second match (“3 + 4”), I also get the same exprs for pre
and post
( “3 + 4”). I was expecting to get “(1 + 2) + 4” for the pre
…which means I am not grokking this properly.
Can someone provide an example where pre
and post
will have different values?
thanks