use DimVector for sizes and strides (#53001)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/53001
Test Plan: Imported from OSS
Reviewed By: swolchok
Differential Revision: D26719508
Pulled By: bhosmer
fbshipit-source-id: 4053d632e11b2de1576c59c5a6b881a195d6206b