Open rsuderman opened 1 year ago
(+1 this can really help clean up IR and makes further stages easier to read as less of this happens in the more verbose forms!)
@NatashaKnk Marking as a P1 for you - please edit as needed.
First part covered in 14494 Is there anybody working on the second part? (i.e. merging the shape manipulation ops together) I can also pick it up in a bit but as we've discussed it might be a good first bug :)
I'd be happy to pick up the second part P.S. if one can flesh out a bit more details - this would be very helpful
Some operations do not manipulate shape at all (specifically unary operations). In these cases we should push shape manipulations through the unary op. E.g.
Has shape manipulations that are unnecessary. These can be corrected by pushing the shape manipulation the elementwise operations:
And ultimately simplified to:
This is also true with
stablehlo.transpose
.