Learn practical skills, build real-world projects, and advance your career
Updated 3 years ago
Assingment 1
fuction i chose for this assingment are randmoly picked from the documentation.
- mean()
- cos()
- sinh()
- atan()
- ones_like()
Before we begin, let's install and import PyTorch
# Import torch and other required modules
import torch
Function 1 - torch.mean()
it takes array asa an input and by using the function we can find the mean of the array.
# Example 1 - working
a=torch.tensor([[1, 2], [3, 4.],[2,6]])
torch.mean(a)
tensor(3.)
Ive taken a array and assinged it to a variable "a" then called the fuction mean()