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.
# Import torch and other required modules
import torch
Function 1 - torch.tensor (change this)
Returns a tensor of any size filled with the specified value.
# Example 1 - working
tensor = torch.tensor([])
tensor.new_full((2, 2), 42.)
tensor([[42., 42.],
[42., 42.]])
Create a tensor of size 2 by 2 and fill it with float of 42.0