Lesson 1: Hello PyTorch¶
Start with the most basic example of Python
In [1]:
Copied!
print("Hello world")
print("Hello world")
Hello world
Import PyTorch¶
Display a PyTorch version and GPU availability
In [2]:
Copied!
import torch
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
import torch
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
PyTorch version: 2.7.0+cu126 CUDA available: True