Learn practical skills, build real-world projects, and advance your career

Tensors

Summary and Further Reading

Try out this assignment to learn more about tensor operations in PyTorch: https://jovian.ai/aakashns/01-tensor-operations

This tutorial covers the following topics:

  • Introductions to PyTorch tensors
  • Tensor operations and gradients
  • Interoperability between PyTorch and Numpy

You can learn more about PyTorch tensors here: https://pytorch.org/docs/stable/tensors.html.

The material in this series is inspired by:

With this, we complete our discussion of tensors and gradients in PyTorch, and we're ready to move on to the next topic: Gradient Descent & Linear Regression.

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.

import torch
# Number
t1 = torch.tensor(4.)
t1
tensor(4.)