You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by MajorTom via Apache TVM Discuss <no...@discuss.tvm.ai> on 2022/03/06 16:15:29 UTC
[Apache TVM Discuss] [Development/pre-RFC] Pattern matching pass
Hi,
I am trying to implement a simple pass that merges a certain pattern into a single "normalize" op. I use the **register_pattern_table** which I understand is support to register the pass.
def make_pattern():
data = wildcard()
data2 = wildcard()
data3 = wildcard()
copy_op = is_op("copy")(data)
reshape1_op = is_op("reshape")(data2)
substract_op = is_op("subtract")(copy_op, reshape1_op)
reshape2_op = is_op("reshape")(data3)
divide_op = is_op("reshape")(substract_op, reshape2_op)
return divide_op
@register_pattern_table
def normalize_pattern():
normalize_pat = ("normalize", make_pattern())
normalize_patterns = [normalize_pat]
return normalize_patterns
I import this code in my test but nothing happens. the code is not called. what am I missing?
It will really help if you could show me a tutorial or example of adding a pattern matching pass end-to-end.
---
[Visit Topic](https://discuss.tvm.apache.org/t/pattern-matching-pass/12249/1) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/5bba2ae042461451c2dd3bd8f5db0f06512267e93537509f547bfed380cab3b7).
[Apache TVM Discuss] [Development/pre-RFC] Pattern matching pass
Posted by masahi via Apache TVM Discuss <no...@discuss.tvm.ai>.
You need to use the `MergeComposite` pass. You can search its usage in our repo.
---
[Visit Topic](https://discuss.tvm.apache.org/t/pattern-matching-pass/12249/2) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/92fdd4a2e315d6a862c6dae9932a746e3d1c3e0611017fc9fbaa73d8052ae812).