import torch print(f"PyTorch版本: {torch.__version__}") print(f"CUDA可用: {torch.cuda.is_available()}") if torch.cuda.is_available(): print(f"当前设备: {torch.cuda.current_device()}") print(f"设备名称: {torch.cuda.get_device_name(0)}") else: print("未检测到可用GPU设备")