Moving parts of the Shape Registry into a common file (#66948)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/66948
Test Plan: Imported from OSS
Reviewed By: malfet
Differential Revision: D32175960
Pulled By: Gamrix
fbshipit-source-id: 2e30115ca554816166fedddbcdeffbe189eb19a6