Account for trivial dimensions in TransposesMinorDimension().
Account for trivial dimensions in TransposesMinorDimension().

We don't care about whether trivial 1-sized dimensions change their position.

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/69033 from tensorflow:tilakrayal-patch-2 63a0146c62a5c5199abfb054dee9d4e9d084eb59
