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: albanD
Differential Revision: D32497550
Pulled By: Gamrix
fbshipit-source-id: 650feded6bae379af3d73a52edac2721bd7af2f2