class_docstr: Build iterator for each epoch.
  
  This class simply creates pytorch DataLoader except for the following points:
  - The random seed is decided according to the number of epochs. This feature
    guarantees reproducibility when resuming from middle of training process.
  - Enable to restrict the number of samples for one epoch. This features
    controls the interval number between training and evaluation.
class_docstr_tok: ["Build","iterator","for","each","epoch",".","This","class","simply","creates","pytorch","DataLoader","except","for","the","following","points",":","-","The","random","seed","is","decided","according","to","the","number","of","epochs",".","This","feature","guarantees","reproducibility","when","resuming","from","middle","of","training","process",".","-","Enable","to","restrict","the","number","of","samples","for","one","epoch",".","This","features","controls","the","interval","number","between","training","and","evaluation","."]
code: def __init__(
      self,
      dataset,
      batches: Union[AbsSampler, Sequence[Sequence[Any]]],
      num_iters_per_epoch: int = None,
      seed: int = 0,
      shuffle: bool = False,
      shuffle_within_batch: bool = False,
      num_workers: int = 0,
      collate_fn=None,
      pin_memory: bool = False,
  ):
      assert check_argument_types()
  
      if not isinstance(batches, AbsSampler):
          self.sampler = RawSampler(batches)
      else:
          self.sampler = batches
  
      self.dataset = dataset
      self.num_iters_per_epoch = num_iters_per_epoch
      self.shuffle = shuffle
      self.shuffle_within_batch = shuffle_within_batch
      self.seed = seed
      self.num_workers = num_workers
      self.collate_fn = collate_fn
      # https://discuss.pytorch.org/t/what-is-the-disadvantage-of-using-pin-memory/1702
      self.pin_memory = pin_memory
  
file_path: espnet/espnet2/iterators/sequence_iter_factory.py
imports: import itertools
  import random
  from functools import partial
  from typing import Any, Sequence, Union
  import numpy
  from torch.utils.data import DataLoader
  from typeguard import check_argument_types
  from espnet2.iterators.abs_iter_factory import AbsIterFactory
  from espnet2.samplers.abs_sampler import AbsSampler
label_desc: Use image node_id 1 to create a new SequenceIterFactory object from inherited base classes: AbsIterFactory with example: obj = SequenceIterFactory(dataset, batches, num_iters_per_epoch, seed, shuffle, shuffle_within_batch, num_workers, collate_fn, pin_memory)