[PyTorch] Use infer_size_dimvector in ExpandUtils (#55180)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55180
Even if we're expanding a Tensor's dimensions, DimVector's size is still a good guess at the rank of a Tensor in general. None of these sites actually seem to need a std::vector.
ghstack-source-id: 126170045
Test Plan: Existing CI
Reviewed By: ezyang
Differential Revision: D27520127
fbshipit-source-id: 4064764fad1b3782b379f04627b48331c3ee011f