Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members Class Reference
Inheritance diagram for

Public Member Functions

def __init__ (self, dataset, num_replicas=None, rank=None)
def __iter__ (self)
def __len__ (self)
def set_epoch (self, epoch)

Public Attributes


Detailed Description

Sampler that restricts data loading to a subset of the dataset.

It is especially useful in conjunction with
:class:`torch.nn.parallel.DistributedDataParallel`. In such case, each
process can pass a DistributedSampler instance as a DataLoader sampler,
and load a subset of the original dataset that is exclusive to it.

.. note::
    Dataset is assumed to be of constant size.

    dataset: Dataset used for sampling.
    num_replicas (optional): Number of processes participating in
        distributed training.
    rank (optional): Rank of the current process within num_replicas.

Definition at line 7 of file

The documentation for this class was generated from the following file: