Skip to content

Pytorch

This module contains the following categories:

category import Applications
utils from random_functions.pytorch import utils Contain helper functions that solves commonly occuring simple tasks while using pytorch

utils

check_dataloaders(*args)

Prints the shape of the provided PyTorch dataloaders.

Usage:

from random_functions.pytorch.utils import check_dataloaders

check_dataloaders(dataloader1, dataloader2, dataloader3)

seed_everything(seed)

This function sets the seed value for random number generator, numpy, torch and cuda(if one is available).

Usage:

from random_functions.pytorch.utils import seed_everything

seed_everything(seed=999)

Parameters:

Name Type Description Default
seed int

This value is set as the seed for reproducing the results

required