Do not modify type map from getCustomClassTypeImpl() (#69261)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69261
As this function is supposed to be called only once per type from
caching getCustomClassType template
Test Plan: Imported from OSS
Reviewed By: suo, lw
Differential Revision: D32776564
Pulled By: malfet
fbshipit-source-id: 218436657e6ad5ad0c87964857114d1e60c57140