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

Assignment 1

An short introduction about PyTorch and about the chosen functions.

  • torch.randn
  • torch.zeros
  • torch.linspace
  • torch.eye
  • torch.reshape
# Import torch and other required modules
import torch

Function 1 - torch.randn

Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).

# Example 1 - working (change this)
a=torch.randn(4)
a
tensor([-0.6694,  0.9630, -0.7820, -0.9715])

Creates random tensor of 1x4