class_docstr: Adapted from `torch.utils.data.distributed.DistributedSampler`.
docstr: Sets the epoch for this sampler.
  
  When `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.
  
  :param epoch: (int) epoch number
code: def set_epoch(self, epoch):
      """Sets the epoch for this sampler.
  
      When `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.
  
      :param epoch: (int) epoch number
      """
      self.epoch = epoch
  
file_path: ludwig/ludwig/data/sampler.py
imports: import math
  import numpy
  from ludwig.distributed import DistributedStrategy
  from ludwig.utils.defaults import default_random_seed
label_desc: Use image node_id 4 for calling the DistributedSampler obj's underlying member method code with example usage: obj.set_epoch(epoch) without return types