Open justinchuby opened 1 month ago
Is there a situation that Reshape-Transpose-Reshape is actually un-rewritable (condition function needed)? Otherwise, this should be simple.
Is there a situation that Reshape-Transpose-Reshape is actually un-rewritable (condition function needed)? Otherwise, this should be simple.
Potentially. I haven't thought deeply on this yet
We can't rewrite this Reshape-Transpose-Reshape to Reshape (and that's true always, unless the Transpose is an identity operation). This can be checked because a Reshape does NOT require any data-movement (it will not change the relative ordering of elements in the tensor), but a Transpose does (unless it does not really tranpose any axes).
But we can eliminate the Reshapes. So, maybe the title should be changed to "Transpose" as the target, not "Reshape"