Learn practical skills, build real-world projects, and advance your career
Updated
4 years ago
A Few Interesting functions in PyTorch
Aditya C
PyTorch is an open source machine learning library and is used for applications such as computer vision and natural language processing. It was primarily developed by Facebook's AI Research lab. It is a free and open-source software.
I have listed a few intersting functions and a few usecases for the same
# Import torch and other required modules
import torch
Function 1 - torch.new_full
Syntax : new_full(size, fill_value, dtype=None, device=None, requires_grad=False) → Tensor
Returns a Tensor of size size filled with fill_value. By default, the returned Tensor has the same torch.dtype.
# Example 1 - working