评价此页

torch.cuda.device_count#

torch.cuda.device_count()[source]#

Return the number of GPUs available.

注意

This API will NOT posion fork if NVML discovery succeeds. See Poison fork in multiprocessing for more details.

返回类型

int