0Pricing
Deep Learning Academy · Lesson

Your First torch.tensor

Create a tensor and print its shape and dtype.

Meet the Tensor

A tensor is PyTorch's core data container, a grid of numbers much like a NumPy array but ready to run on a GPU. 🧮

Create One from a List

The simplest way to make a tensor is torch.tensor from a Python list. PyTorch copies your numbers into a fast numerical grid.

x = torch.tensor([1, 2, 3])

All lessons in this course

  1. Install PyTorch and Verify It Imports
  2. CPU vs GPU vs MPS: Pick a Device
  3. Notebooks, Scripts & Reproducible Seeds
  4. Your First torch.tensor
← Back to Deep Learning Academy