CPU vs GPU vs MPS: Pick a Device
Detect CUDA, Apple MPS, or fall back to CPU.
Where Math Happens
Every tensor lives on a device: the CPU, a GPU, or Apple's MPS. The device decides how fast your model trains. ⚡
The CPU Always Works
Your CPU is the safe default. It runs every PyTorch operation, just more slowly on the heavy matrix math that big networks demand.
All lessons in this course
- Install PyTorch and Verify It Imports
- CPU vs GPU vs MPS: Pick a Device
- Notebooks, Scripts & Reproducible Seeds
- Your First torch.tensor