Learn practical skills, build real-world projects, and advance your career
Created 4 years ago
Pytorch Tutorial from freeCodeCamp.org
Episode 1 Pytorch Basics and Linear Regression
# import Pytorch
import torch
Tensors
At its core, PyTorch is a library for processing tensors. A tensor is a number, vector, matrix or any n-dimensional array. Let's create a tensor with a single number:
# Number
t1 = torch.tensor(4.)
t1
tensor(4.)