Open
Description
After #121 our Fusion rewrite still does not merge subgraphs that share some inputs but are otherwise not connected
import pytensor
import pytensor.tensor as pt
x = pt.vector("x")
y1 = pt.exp(pt.sin(x))
y2 = pt.sin(pt.exp(x))
fn = pytensor.function([x], [y1, y2])
pytensor.dprint(fn)
That is added as an xfail test for now. I consider that an improvement we can do in a follow-up. I would do it as a rewrite that tries to combine multiple Composites with common inputs, done after the Fusion rewrite.
Originally posted by @ricardoV94 in #121 (comment)