Closed
Description
Description
#121 disables the inplacing of Elemwise Composite Ops to cases with more than one output, as the InplaceElemwiseOptimizer was otherwise faulty for Composites that have nested outputs
One simple solution for multiple outputs, is to only allow in-placing from the last toposorted output. Otherwise, if we want to support multiple inplacing we can try something fancier by introspecting the inner graph.
Currently there is no good utility we can reuse. IIRC PyTensor usually attempts brute-force inplacing rewrite and backtracks when that would invalidate the graph. That approach doesn't sound great, so I suggest we try something else.