Is there a pytorch method to check the number of cpus?
At present pytorch doesn't support multiple cpu cluster in DistributedDataParallel implementation. So, I am assuming you mean number of cpu cores.
There's no direct equivalent for the gpu count method but you can get the number of threads which are available for computation in pytorch by using

torch.get_num_threads()
I can use this torch.cuda.device_count() to check the number of GPUs. I was wondering if there was something equivalent to check the number of CPUs.