import torch | |
if torch.cuda.is_available(): | |
device = torch.device("cuda") | |
print(f"GPU {torch.cuda.get_device_name(0)} is available") | |
else: | |
device = torch.device("cpu") | |
print("No GPU available, using CPU instead") |
import torch | |
if torch.cuda.is_available(): | |
device = torch.device("cuda") | |
print(f"GPU {torch.cuda.get_device_name(0)} is available") | |
else: | |
device = torch.device("cpu") | |
print("No GPU available, using CPU instead") |