@t-vi Sorry for my delay, I had a lot of meetings today. I've finally read 
through this enough to grok the problem. I'm not sure the Pattern Language is 
the right tool for this pass. 

As you said here:

[quote="t-vi, post:3, topic:7012"]
I’m always wondering whether I’m missing ready-made passes of removing some of 
the typical overhead of automatic differentiation (e.g. replacing `..._like` 
with static ops or removing broadcasting / collapse_sum etc. If not, would 
these be useful to make available?
[/quote]

This looks like more of a need for removing dynamic ops. I'm actually working 
on a pass like that related to 
https://discuss.tvm.ai/t/dynamic-ops-in-relay/6909/17. The pass basically does 
a loop of infer_type, fold constants, replace dynamic ops with constant or 
static versions, repeat.

There's a POC up here: 
https://github.com/apache/incubator-tvm/pull/5826/files#diff-4e809b75f719ad7ca8fdad6300b3ae32

It doesn't support many use cases yet, but I can imagine plugging 
ones_like/zeros_like/broadcast_to_like in that pass and getting this behavior 
in a fairly straightforward way.





---
[Visit Topic](https://discuss.tvm.ai/t/same-shape-pattern/7012/15) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/7e2a3043876b54c1716e8a84221e5637aae82f5e0d1859f76823adf7edb9f79a).

Reply via email to