評價此頁

torch.cuda.device_count#

torch.cuda.device_count()[原始碼]#

返回可用的 GPU 數量。

注意

如果 NVML 發現成功,此 API 不會毒化 fork。有關更多詳細資訊,請參閱 多程序中的 Poison fork

返回型別

int