code: def resample(self, seed=None):
          
          if seed is not None:
              gen = torch.manual_seed(seed)
          else:
              gen = torch.default_generator
  
          if self.replacement:
              self.perm = torch.LongTensor(len(self)).random_(
                  len(self.dataset), generator=gen)
          else:
              self.perm = torch.randperm(
                  len(self.dataset), generator=gen).narrow(0, 0, len(self))
docs: Resample the dataset.
  
          Args:
              seed (int, optional): Seed for resampling. By default no seed is
              used.