[JIT] Put explicit error message on class attribute accesses. (#55723)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55723
Resolving https://github.com/pytorch/pytorch/issues/51139
Test Plan:
python test/test_jit.py TestClassType.test_unresolved_attributes
Imported from OSS
Reviewed By: gmagogsfm
Differential Revision: D27691960
fbshipit-source-id: 1d078a4ab25af1a73109ca6ef0333a67a634bff6