Recursively compile class types (#22475)
Summary:
Try to compile for class types encountered in recursive script
](https://our.intern.facebook.com/intern/diff/16340717/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22475
Pulled By: driazati
Differential Revision: D16340717
fbshipit-source-id: 5e1a46db517be2412f57156efbc4eb3347b01a8a