class_docstr: Similar to TrainingSampler, but a sample may appear more times than others based
  on its "repeat factor". This is suitable for training on class imbalanced datasets like LVIS.
class_docstr_tok: ["Similar","to","TrainingSampler",",","but","a","sample","may","appear","more","times","than","others","based","on","its","``","repeat","factor","''",".","This","is","suitable","for","training","on","class","imbalanced","datasets","like","LVIS","."]
code: def _infinite_indices(self):
      g = torch.Generator()
      g.manual_seed(self._seed)
      while True:
          # Sample indices with repeats determined by stochastic rounding; each
          # "epoch" may have a slightly different size due to the rounding.
          indices = self._get_epoch_indices(g)
          if self._shuffle:
              randperm = torch.randperm(len(indices), generator=g)
              yield from indices[randperm].tolist()
          else:
              yield from indices.tolist()
  
imports: import itertools
  import logging
  import math
  from collections import defaultdict
  from typing import Optional
  import torch
  from torch.utils.data.sampler import Sampler
  from detectron2.utils import comm
label_desc: Use image node_id 5 for calling the RepeatFactorTrainingSampler obj's underlying member method code with example usage: obj._infinite_indices() without return types