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

Jovian.ml

Deep Learning with Pytorch from Zero to GANS

Assignment 1: 5 tensor functions

  1. Creation Ops
  2. Reshape
  3. Indexing, slicing
  4. Some maths
  5. Calculus
import numpy as np
import torch

1. Creation Ops

  • Create a tensor from lists
t1 = torch.tensor([[0.1, 1.2], [2.2, 3.1], [4.9, 5.2]])
t1
tensor([[0.1000, 1.2000],
        [2.2000, 3.1000],
        [4.9000, 5.2000]])