Merge torchdim into functorch build (#82454)
This moves first-class dimensions, as prototyped in https://github.com/facebookresearch/torchdim
into the functorch build. This makes them availiable for use in PrimTorch more easily.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82454
Approved by: https://github.com/ezyang, https://github.com/zou3519