Three operators are added that can be used to decrease the number of
transpose/reshape occurences. These operators are:
- Swap elementwise
- Swap reshape-transpose
- Fuse transpose-reshape
Swap elementwise groups operations that operate on value, and move values. This
allows all movement operations (reshape, transpose, etc) to group at one
portion of the graph while value manipulations group on the other end.
Swap reshape/transpose finds cases where the reshape-transpose can be reorderd.
This allows the reshape-transpose-reshape case to be transformed to
transpose-reshape-reshape, which can then merge the reshape-reshape.
Finally the transpose-reshape merge allows cases where, when reshape maintains
the same dimensions and does not affect memory ordering, the transpose and
reshape can be merged into a single transpose operator.
PiperOrigin-RevId:
191462038