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

Let's throw some "Torch" on Tensor Operations

Deep learning allows us to carry out a very wide range of complicated tasks. In order to carry out our tasks effectively, we need a tool which is flexible. Pytorch gives us this option because of its simplicity. It provides accelerated operations using GPU's (Graphical Processing Units). Due to this reason of Pytorch being a high performance library that it has gained its popularity. The below notebook consists of some essential functions which are very useful in carrying out tensor operations. These operations are used for multi-dimensional tensors & for arithematic operations.
  • General Ops
  • Creation Ops
  • Arithematic Ops
  • Mutating Ops
  • Reduction Ops

Before we begin, let's install and import PyTorch

# Uncomment and run the appropriate command for your operating system, if required

# Linux / Binder
# !pip install numpy torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# Windows
# !pip install numpy torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# MacOS
# !pip install numpy torch torchvision torchaudio
# Import torch and other required modules
import torch