torch.cuda.device_count#
- torch.cuda.device_count()[source]#
Return the number of GPUs available.
Note
This API will NOT posion fork if NVML discovery succeeds. See Poison fork in multiprocessing for more details.
- Return type
Return the number of GPUs available.
Note
This API will NOT posion fork if NVML discovery succeeds. See Poison fork in multiprocessing for more details.