enable CPU tests back (#50490)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50490
Right now CPU tests are skipped because it always failed in checking 'torch.cuda.device_count() < int(self.world_size)',
enable CPU tests back by checking device count only when cuda is available
Test Plan: unit tests, CPU tests are not skipped with this diff
Reviewed By: rohan-varma
Differential Revision: D25901980
fbshipit-source-id: e6e8afe217604c5f5b3784096509240703813d94