Add test_imports (#77728)
That validates that every PyTorch submodule can be imported
Prevents regressions like the one described in https://github.com/pytorch/pytorch/issues/77441 from happening in the future
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77728
Approved by: https://github.com/seemethere, https://github.com/janeyx99