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.
code: def __init__(
      self,
      dataset,
      batches: Union[AbsSampler, Sequence[Sequence[Any]]],
      num_iters_per_epoch: int = None,
      seed: int = 0,
      sampler_args: dict = None,
      shuffle: 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.sampler_args = sampler_args
      self.shuffle = shuffle
      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
  
imports: import itertools
  import logging
  import random
  from functools import partial
  from typing import Any, Sequence, Union
  import numpy
  import torch
  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
  from espnet2.samplers.category_balanced_sampler import CategoryBalancedSampler
label_desc: Use image node_id 1 to create a new CategoryIterFactory object from inherited base classes: AbsIterFactory with example: obj = CategoryIterFactory(dataset, batches, num_iters_per_epoch, seed, sampler_args, shuffle, num_workers, collate_fn, pin_memory)