pytensor
pytensor copied to clipboard
Add graph transformation to propagate new static shape info
Description
A considerable limitation of graph_replace vs clone_replace is that it does not rebuild the graph downstream when static types are different (yet compatible). Also our rewrites may benefit from this, if we have a pass now and then that just refreshes all static types by recalling Op.make_node() when input types haves changed. As it is now, types are only propagated during rewrites, accidentally when new nodes are created.
Back to graph_replace, this could then be combined with such a rewrite, to obtain the missing functionality relative to clone_replace, with still the benefits of not cloning stuff that is not needed.