File size: 303 Bytes
ac4f80f
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import torch

def check_device():
    if torch.cuda.is_available():
        print("✅ GPU is available!")
        print(f"Using GPU: {torch.cuda.get_device_name(0)}")
    else:
        print("❌ GPU is not available.")
        print("Using CPU instead.")

if __name__ == "__main__":
    check_device()