class_docstr: Produce indices for inference.
  Inference needs to run on the __exact__ set of samples,
  therefore when the total number of samples is not divisible by the number of workers,
  this sampler produces different number of samples on different workers.
class_docstr_tok: ["Produce","indices","for","inference",".","Inference","needs","to","run","on","the","__exact__","set","of","samples",",","therefore","when","the","total","number","of","samples","is","not","divisible","by","the","number","of","workers",",","this","sampler","produces","different","number","of","samples","on","different","workers","."]
code: def __iter__(self):
      yield from self._local_indices
  
imports: import itertools
  import math
  from collections import defaultdict
  from typing import Optional
  import torch
  from torch.utils.data.sampler import Sampler
  from ....utils import comm
label_desc: Use image node_id 2 for calling the InferenceSampler obj's underlying member method code with example usage: obj.__iter__() without return types