Add torch.overrides checks for submodules. (#47285)
Summary:
Partially addresses the override component of https://github.com/pytorch/pytorch/issues/42666 and https://github.com/pytorch/pytorch/issues/42175.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47285
Reviewed By: agolynski
Differential Revision: D24706493
Pulled By: ezyang
fbshipit-source-id: bf5a742ac7002dce5a9a454a945f1994b4c8b93e