pyiqa.data.data_sampler ======================= .. py:module:: pyiqa.data.data_sampler Module Contents --------------- .. py:class:: EnlargedSampler(dataset, num_replicas, rank, ratio=1, use_shuffle=True) Bases: :py:obj:`torch.utils.data.sampler.Sampler` Sampler that restricts data loading to a subset of the dataset. Modified from torch.utils.data.distributed.DistributedSampler Support enlarging the dataset for iteration-based training, for saving time when restart the dataloader after each epoch :param dataset: Dataset used for sampling. :type dataset: torch.utils.data.Dataset :param num_replicas: Number of processes participating in the training. It is usually the world_size. :type num_replicas: int | None :param rank: Rank of the current process within num_replicas. :type rank: int | None :param ratio: Enlarging ratio. Default: 1. :type ratio: int .. py:method:: set_epoch(epoch)