I have a sample graph as attached in the picture below . I want to look for the pattern in the blue and replace with a direct connection. The pattern matches as long every op in the pattern has uses in the same pattern but when it has a use outside the pattern I stop getting matches. Is there a way to work around this, or is there fundamental limitation of relay’s pattern-matching? I am doing all this pattern matching based on Pattern Matching in Relay — tvm 0.11.dev0 documentation . It would be nice to have section about limitations of relay_pattern.
Is there also a way to find out easily number of uses and each user of an op/expr based on python api? Any readily available utility function which can share this info can be very useful.