Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members
torch.utils.data.distributed.DistributedSampler Class Reference
Inheritance diagram for torch.utils.data.distributed.DistributedSampler:

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

 dataset
 
 num_replicas
 
 rank
 
 epoch
 
 num_samples
 
 total_size
 

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.

Arguments:
    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 distributed.py.


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