class_docstr: Some common benchmarks that help understand perf bottleneck of a standard dataloader
  made of dataset, mapper and sampler.
class_docstr_tok: ["Some","common","benchmarks","that","help","understand","perf","bottleneck","of","a","standard","dataloader","made","of","dataset",",","mapper","and","sampler","."]
docstr: Benchmark the speed of taking raw samples from the dataset and map
  them in a single process.
docstr_tok: ["Benchmark","the","speed","of","taking","raw","samples","from","the","dataset","and","map","them","in","a","single","process","."]
code: def benchmark_mapper(self, num_iter, warmup=5):
      """
      Benchmark the speed of taking raw samples from the dataset and map
      them in a single process.
      """
  
      def loader():
          while True:
              for k in self.sampler:
                  yield self.mapper(self.dataset[k])
  
      self._benchmark(
          loader(),
          num_iter,
          warmup,
          "Single Process Mapper (sec/sample)",
      )
  
imports: import logging
  import numpy
  from itertools import count
  from typing import List, Tuple
  import torch
  import tqdm
  from fvcore.common.timer import Timer
  from detectron2.utils import comm
  from .build import build_batch_data_loader
  from .common import DatasetFromList, MapDataset
  from .samplers import TrainingSampler
label_desc: Use image node_id 5 for calling the DataLoaderBenchmark obj's underlying member method code with example usage: obj.benchmark_mapper(num_iter, warmup) without return types