评价此页

torch.cuda.device_count#

torch.cuda.device_count()[源代码]#

返回可用的 GPU 数量。

注意

如果 NVML 发现成功,此 API 不会毒化 fork。有关更多详细信息,请参阅 多进程中的 Poison fork

返回类型

int