make `to` properly support permutation (#77610)
Fixes #77600 (tests to come from #77585)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77610
Approved by: https://github.com/ezyang, https://github.com/mruberry
Author
Natalia Gimelshein