Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
Tensor operations in Pytorch
I picked five tensor operations that are interesting and useful for many fields and provide an example for each operation.
What is tensor?
Tensor is referring to high dimensional matrices(width and height), for even more dimensions which have depth, each depth layer is a matrix. Each matrix has a row or column vector, each vector consisted of scalar numbers.
Before we jump, let's take a quick review on data types!
A tensor can be constructed with these data types: float, integer, boolean:
# Import torch and other required modules
import torch