@comaniac OK I see. I think FunctionPattern would solve it all for me here.
Glad to see the team has a plan on this!
@mbrookhart
[quote="mbrookhart, post:5, topic:8283, full:true"]
It will definitely go inside the function to match patterns, but you're right,
we don't have a Function Pattern right now, we should probably add one.
This seems to be a function created by the FuseOps pass. Typically we'd do
pattern rewriting/partitioning before that, maybe there's a simpler way to get
what you're looking for?
[/quote]
I have tried using this to match
```
pattern = is_op('nn.conv2d')(wildcard(), wildcard())
pattern = is_op('multiply')(pattern, wildcard())
pattern = is_op('add')(pattern, wildcard())
tuple_get_item_node = TupleGetItemPattern(pattern, 0)
pattern = is_op('nn.relu')(tuple_get_item_node)
```
but it returns false. Looks like it doesn't go inside the function. I also
tried disabling FuseOps and insert
MergeComposite after Optimize() has finished, but it throws an error saying
something like "`add` is detected and will be removed by future passes."
Just to see if there's any luck here. Is there a way to get it work with the
current code base?
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-match-the-pattern-of-a-function-in-relay/8283/15)
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/5879ca7f328d363d2931553693b51f73a3891bc1c610ce843130a48d2a9b6d44).