[caffe2] Shape inference for Transpose (#55188)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55188
We need to make sure dim types are preserved after applying Transpose.
Test Plan:
```
$ buck build caffe2/caffe2/opt:bound_shape_inference_test && ./buck-out/gen/caffe2/caffe2/opt/bound_shape_inference_test --gtest_filter=*Transpose*
```
Reviewed By: yinghai
Differential Revision: D27514487
fbshipit-source-id: 431b7f2d08664f2ec311a733c926dbb52c63a7d4