code: def __init__(self, *args, generator=None, **kwargs):
      # generator = torch.Generator().manual_seed(seed)
      # super().__init__(*args, generator=generator, **kwargs)
      # TD [2022-07-17]: We don't force the seed to be zero. We generate random seed,
      # which should be reproducible if pl.seed_everything was called before hand.
      # This means that changing the seed of the experiment will also change the
      # sampling order.
      if generator is None:
          seed = int(
              torch.empty((), dtype=torch.int64).random_().item()
          )
          generator = torch.Generator().manual_seed(seed)
      super().__init__(*args, generator=generator, **kwargs)
      self.counter = 0
      # self.start_counter = 0
      self.restarting = False
  
file_path: zoo/src/datamodules/fault_tolerant_sampler.py
imports: from typing import Iterator
  import math
  import torch
  from torch.utils.data import RandomSampler, DistributedSampler
label_desc: Use image node_id 1 to create a new RandomFaultTolerantSampler object from inherited base classes: RandomSampler with example: obj = RandomFaultTolerantSampler()