class_docstr: Class representing a dataset abstraction.
  
  This class wraps a :class:`torch.utils.data.Dataset` via the `dataset` attribute
  and configures the dataloaders needed to access the datasets. By default,
  this class will use `DEFAULT_NUM_WORKERS` processes to load the data
  (num_workers in :class:`torch.utils.data.DataLoader`).
  Transforms which need to be applied to the data should be specified in this class.
  ClassyDataset can be instantiated from a configuration file as well.
class_docstr_tok: ["Class","representing","a","dataset","abstraction",".","This","class","wraps","a",":","class",":","`","torch.utils.data.Dataset","`","via","the","`","dataset","`","attribute","and","configures","the","dataloaders","needed","to","access","the","datasets",".","By","default",",","this","class","will","use","`","DEFAULT_NUM_WORKERS","`","processes","to","load","the","data","(","num_workers","in",":","class",":","`","torch.utils.data.DataLoader","`",")",".","Transforms","which","need","to","be","applied","to","the","data","should","be","specified","in","this","class",".","ClassyDataset","can","be","instantiated","from","a","configuration","file","as","well","."]
docstr: Return a :class:`torch.utils.data.sampler.Sampler` to sample the data.
  
  This is used to distribute the data across the replicas. If shuffling
  is enabled, every epoch will have a different shuffle.
  
  Args:
      epoch: The epoch being fetched.
  
  Returns:
      A sampler which tells the data loader which sample to load next.
docstr_tok: ["Return","a",":","class",":","`","torch.utils.data.sampler.Sampler","`","to","sample","the","data",".","This","is","used","to","distribute","the","data","across","the","replicas",".","If","shuffling","is","enabled",",","every","epoch","will","have","a","different","shuffle",".","Args",":","epoch",":","The","epoch","being","fetched",".","Returns",":","A","sampler","which","tells","the","data","loader","which","sample","to","load","next","."]
code: def _get_sampler(self, epoch: int):
      """
      Return a :class:`torch.utils.data.sampler.Sampler` to sample the data.
  
      This is used to distribute the data across the replicas. If shuffling
      is enabled, every epoch will have a different shuffle.
  
      Args:
          epoch: The epoch being fetched.
  
      Returns:
          A sampler which tells the data loader which sample to load next.
      """
      world_size = get_world_size()
      rank = get_rank()
      sampler = DistributedSampler(
          self, num_replicas=world_size, rank=rank, shuffle=self.shuffle
      )
      sampler.set_epoch(epoch)
      return sampler
  
file_path: ClassyVision/classy_vision/dataset/classy_dataset.py
imports: from typing import Any, Callable, Dict, Optional, Sequence, Union
  from classy_vision.dataset.transforms import ClassyTransform
  from classy_vision.generic.distributed_util import get_rank, get_world_size
  from classy_vision.generic.util import is_pos_int, log_class_usage
  from torch.utils.data import DataLoader
  from torch.utils.data.distributed import DistributedSampler
label_desc: Use image node_id 7 for calling the ClassyDataset obj's underlying member method code with example usage: obj._get_sampler(epoch) and returns: sampler