0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PyTorch Memo 備忘録

Posted at

1. GPU確認コード

00.torch_gpu.py
import torch

print("PyTorch version:", torch.__version__)

if torch.cuda.is_available():
    device = torch.device("cuda")          # a CUDA device object
    print(f"Using {torch.cuda.get_device_name()} for PyTorch")
else:
    device = torch.device("cpu")           # a CPU object
    print("No GPU available, using CPU for PyTorch")
result
PyTorch version: 2.0.1+cu118
Using NVIDIA GeForce RTX 3060 Laptop GPU for PyTorch
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?