Explain it in 60 seconds
Using GPUs in PyTorch
Machine Learning · ML Frameworks · Beginner
How do you use a GPU in PyTorch, and what are common mistakes?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Move model and tensors to device (.to("cuda")).
- All tensors in an operation must be on same device.
- Check availability (torch.cuda.is_available; mps on Mac).
- Avoid frequent CPU-GPU transfers (.item(), .cpu() in loop).
- Monitor memory; OOM errors.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.