docstr: Sets the epoch for this sampler.
  
  When :attr:`shuffle=True`, this ensures all replicas use a different
  random ordering for each epoch. Otherwise, the next iteration of this
  sampler will yield the same ordering.
  
  Args:
      epoch (int): Epoch number.
docstr_tok: ["Sets","the","epoch","for","this","sampler",".","When",":","attr",":","`","shuffle=True","`",",","this","ensures","all","replicas","use","a","different","random","ordering","for","each","epoch",".","Otherwise",",","the","next","iteration","of","this","sampler","will","yield","the","same","ordering",".","Args",":","epoch","(","int",")",":","Epoch","number","."]
code: def set_epoch(self, epoch: int) -> None:
      """Sets the epoch for this sampler.
  
      When :attr:`shuffle=True`, this ensures all replicas use a different
      random ordering for each epoch. Otherwise, the next iteration of this
      sampler will yield the same ordering.
  
      Args:
          epoch (int): Epoch number.
      """
      self.epoch = epoch
  
file_path: mmdetection/mmdet/datasets/samplers/custom_sample_size_sampler.py
imports: import math
  from typing import Iterator, Optional, Sequence, Sized
  import torch
  from mmengine.dist import get_dist_info, sync_random_seed
  from torch.utils.data import Sampler
  from mmdet.registry import DATA_SAMPLERS
  from .class_aware_sampler import RandomCycleIter
label_desc: Use image node_id 4 for calling the CustomSampleSizeSampler obj's underlying member method code with example usage: obj.set_epoch(epoch) without return types