Fix public binding check to check all submodules (#110601)
Fix https://github.com/pytorch/pytorch/issues/86619
The test to make sure modules are importable is being added at https://github.com/pytorch/pytorch/pull/110598
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110601
Approved by: https://github.com/zou3519