Ravindra BagaleCourses & study guides मराठी Track your progress

44. Install PyTorch and First Tensors

44.1 Install PyTorch Simply

Why. Theory is done enough — time to install the library we will use for deep learning on this site: PyTorch (not Keras-first).

What. PyTorch is a popular Python library for tensors and neural nets. CPU install is enough for these beginner chapters. GPU is optional speed.

How.

Install in a venv (recommended)

  1. Create/activate a virtual environment.
  2. Install from the official command on pytorch.org for your OS (CPU build is fine).
  3. Or try: pip install torch inside the venv.
  4. Verify with a one-line import.
import torch
print(torch.__version__)
print("cuda available:", torch.cuda.is_available())

What you should see. A version string. cuda available: False is OK on many laptops — chapters still run on CPU.

Classroom note

If install fails behind a proxy, ask your trainer for the offline wheel. Do not paste random .exe files from the web.