Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
Title Here
Subtitle Here
An short introduction about PyTorch and about the chosen functions.
- torch.cos(input, out=None)
- torch.reciprocal(input, out=None)
- torch.cat(tensors, dim=0, out=None) → Tensor
- torch.linspace(start, end, steps=100, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
- torch.full(size, fill_value, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
# Import torch and other required modules
import torch
torch.cos(input, out=None)
This function takes an input and outputs the cosine of that function.
# Working
torch.cos(torch.randn(1))
tensor([0.9236])
It is generating a random integer using randn() function and gives output of cosine of that input