Add error messages and workaround for RET failure of containers with a torch class type (#46543)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46543
Add error messages and workaround for RET failure of containers with a torch class type.
- Error case condition
1) ins.op == RET
2) input_type == TypeKind::ListType or TypeKind::DictType
3) Any(input_type's element type) == TypeKind::ClassType
ghstack-source-id: 114618426
Test Plan:
buck test mode/dev caffe2/test:mobile -- 'test'
Summary
Pass: 13
ListingSuccess: 1
Finished test run: https://our.intern.facebook.com/intern/testinfra/testrun/7318349417617713
Reviewed By: iseeyuan
Differential Revision: D24388483
fbshipit-source-id: 7d30f6684a999054d0163e691422797cb818bb6a