You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import torch
|
|
import sys
|
|
if torch.cuda.is_available():
|
|
# 获取可用的GPU数量
|
|
num_gpus = torch.cuda.device_count()
|
|
print(f'可用的GPU数量: {num_gpus}')
|
|
else:
|
|
print('当前系统没有CUDA支持的GPU')
|
|
print(torch.version.cuda)
|
|
print("Python version:", sys.version) |