[PyTorch] Use DimVector in at::matmul (#72230)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72230
Here's a small PR that only fixes the extra heap allocations for shapes. Hopefully won't get stuck like #64387.
ghstack-source-id: 149069527
Test Plan: CI
Reviewed By: ngimel
Differential Revision: D33962610
fbshipit-source-id: 51e200f5237bdf225bfb2445e1e36bacd0e65e92
(cherry picked from commit 027537f32965d23fc78a36fec71be41cd5cbce3d)