docstr: Generate samplers for local data set in given epoch
docstr_tok: ["Generate","samplers","for","local","data","set","in","given","epoch"]
code: def _get_local_samplers(self, epoch):
      """Generate samplers for local data set in given epoch"""
      seed = int(
          self.base_seed
          + epoch
          + self.epochs * self.rank
          + self.epoch * self.epochs * self.world_size
      )
      g = torch.Generator()
      g.manual_seed(seed)
      samplers = []
      for t in range(self.num_classes):
          t_indices = np.array(self.class_index[t])
          if not self.unique_cpb:
              i_size = len(t_indices) // self.world_size
              if i_size > 0:
                  t_indices = t_indices[
                      self.rank * i_size : (self.rank + 1) * i_size
                  ]
          if len(t_indices) > 1:
              t_indices = t_indices[
                  torch.randperm(len(t_indices), generator=g)
              ]
          samplers.append(iter(t_indices))
      return samplers
  
imports: import contextlib
  import logging
  import queue
  from typing import Dict, List
  import numpy
  import torch
  from PIL import Image
  from torch.utils.data import Dataset
  from torch.utils.data.distributed import DistributedSampler
label_desc: Use image node_id 8 for calling the StratifiedClassSampler obj's underlying member method code with example usage: obj._get_local_samplers(epoch) and returns: samplers