Fix pickling for Tensor subclasses (redo) (#47732)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/47051
Redo of https://github.com/pytorch/pytorch/issues/47115
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47732
Reviewed By: izdeby
Differential Revision: D25465382
Pulled By: ezyang
fbshipit-source-id: 3a8d57281a2d6f57415d5735d34ad307f3526638