Tensor by Tensor

02.01 · UNIT 01 · PyTorch in One Hour: foundations · Lesson

What is PyTorch

PyTorch is an open-source deep learning library. It has three parts: a tensor library, an autograd engine, and the deep learning utilities.

PLAIN-LANGUAGE INTRODUCTION

What is this?

PyTorch is an open-source deep learning library. It has three parts: a tensor library, an autograd engine, and the deep learning utilities.

One simple example

On a CPU-only machine, torch.__version__ prints 2.4.1, and torch.cuda.is_available() prints False.

What goes in?

A Python environment and the torch package.

What comes out?

A working PyTorch install that reports its version and GPU support.

Why does it matter?

The version and device checks prevent later failures from a wrong build.

What is it not?

The import name is torch, not pytorch.

WORK THROUGH THE IDEA

See the idea in more detail

  1. PyTorch is an open-source deep learning library that uses Python.
  2. It has three core parts: a tensor library, an automatic differentiation engine, and a deep learning library of layers, losses, and optimizers.
  3. AI contains machine learning, and machine learning contains deep learning. Deep learning trains deep neural networks.
  4. Install PyTorch with pip install torch. Use a Python version one or two releases older than the newest.
  5. Common mistake: a default install can be CPU-only. Check torch.cuda.is_available() and name the CUDA version when a GPU is required.
Open the detailed notes ↗