[JIT] Serialize attributes and types in ClassType serialization
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32555
Test Plan: Imported from OSS
Differential Revision: D19544737
Pulled By: jamesr66a
fbshipit-source-id: 2256cfba414a850cdc986bb5872dd4cb177b456c