Ben Chuanlong Du's Blog

It is never too late to learn.

Popular and Useful Modules and Functions in PyTorch

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Functions

torch.load

torch.from_numpy

torch.tensor

torch.as_tensor

torch.flatten

torch.numel

torch.utils.data.random_split

torch.nn.functional.relu

torch.nn.functional.leaky_relu

torch.nn.functional.gelu

torch.nn.functional.logsigmoid

torch.nn.functional.softmin

torch.nn.functional.softmax

torch.nn.functional.log_softmax

torch.nn.functional.sigmoid

torch.nn.functional.batch_norm

torch.nn.functional.normalize

Modules

Transforms

torchvison.transforms.ToTensor

torchvision.transforms.Normalize

torchvision.transforms.Compose

Referneces

Using Dropout in Pytorch: nn.Dropout vs. F.dropout

How does transforms.ToTensor() work and computation of mean and std values

Comments