Reputation: 1844
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.
Upvotes: 17
Views: 14450
Reputation: 167
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()
Upvotes: 6