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: Returns an iterable which can be used to iterate over the data.
  
  Args:
      shuffle_seed (int, optional): Seed for the shuffle
      current_phase_id (int, optional): The epoch being fetched. Needed so that
          each epoch has a different shuffle order
  Returns:
      An iterable over the data
docstr_tok: ["Returns","an","iterable","which","can","be","used","to","iterate","over","the","data",".","Args",":","shuffle_seed","(","int",",","optional",")",":","Seed","for","the","shuffle","current_phase_id","(","int",",","optional",")",":","The","epoch","being","fetched",".","Needed","so","that","each","epoch","has","a","different","shuffle","order","Returns",":","An","iterable","over","the","data"]
code: def iterator(self, *args, **kwargs):
      """
      Returns an iterable which can be used to iterate over the data.
  
      Args:
          shuffle_seed (int, optional): Seed for the shuffle
          current_phase_id (int, optional): The epoch being fetched. Needed so that
              each epoch has a different shuffle order
      Returns:
          An iterable over the data
      """
      # TODO: Fix naming to be consistent (i.e. everyone uses epoch)
      shuffle_seed = kwargs.get("shuffle_seed", 0)
      assert isinstance(
          shuffle_seed, int
      ), "Shuffle seed must be an int"
      epoch = kwargs.get("current_phase_id", 0)
      assert isinstance(epoch, int), "Epoch must be an int"
      num_workers_override = kwargs.get("num_workers", self.num_workers)
      if num_workers_override == 0:
          # set the mp context to None to placate the PyTorch dataloader
          kwargs["multiprocessing_context"] = None
  
      offset_epoch = shuffle_seed + epoch
  
      return DataLoader(
          self,
          batch_size=self.batchsize_per_replica,
          num_workers=num_workers_override,
          pin_memory=kwargs.get("pin_memory", False),
          worker_init_fn=kwargs.get("worker_init_fn", None),
          multiprocessing_context=kwargs.get(
              "multiprocessing_context", None
          ),
          sampler=self._get_sampler(epoch=offset_epoch),
      )
  
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 8 for calling the ClassyDataset obj's underlying member method code with example usage: obj.iterator() and returns: DataLoader