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: Args:
      max_time_seconds (int): maximum time to spent for each benchmark
      other args: same as in `build.py:build_detection_train_loader`
docstr_tok: ["Args",":","max_time_seconds","(","int",")",":","maximum","time","to","spent","for","each","benchmark","other","args",":","same","as","in","`","build.py",":","build_detection_train_loader","`"]
code: def __init__(
      self,
      dataset,
      *,
      mapper,
      sampler=None,
      total_batch_size,
      num_workers=0,
      max_time_seconds: int = 90,
  ):
      """
      Args:
          max_time_seconds (int): maximum time to spent for each benchmark
          other args: same as in `build.py:build_detection_train_loader`
      """
      if isinstance(dataset, list):
          dataset = DatasetFromList(dataset, copy=False, serialize=True)
      if sampler is None:
          sampler = TrainingSampler(len(dataset))
  
      self.dataset = dataset
      self.mapper = mapper
      self.sampler = sampler
      self.total_batch_size = total_batch_size
      self.num_workers = num_workers
      self.per_gpu_batch_size = (
          self.total_batch_size // comm.get_world_size()
      )
  
      self.max_time_seconds = max_time_seconds
  
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 1 to create a new DataLoaderBenchmark object  with example: obj = DataLoaderBenchmark(dataset)