torch_cuda_test.py 280 B

123456
  1. import torch
  2. print("torch.cuda.is_available() =", torch.cuda.is_available())
  3. print("torch.cuda.device_count() =", torch.cuda.device_count())
  4. print("torch.cuda.device('cuda') =", torch.cuda.device('cuda'))
  5. print("torch.cuda.current_device() =", torch.cuda.current_device())