class_docstr: The dataloader benchmark class. It will be statistical inference FPS and
  CPU memory information.
  
  Args:
      cfg (mmengine.Config): config.
      distributed (bool): distributed testing flag.
      dataset_type (str): benchmark data type, only supports ``train``,
          ``val`` and ``test``.
      max_iter (int): maximum iterations of benchmark. Defaults to 2000.
      log_interval (int): interval of logging. Defaults to 50.
      num_warmup (int): Number of Warmup. Defaults to 5.
      logger (MMLogger, optional): Formatted logger used to record messages.
class_docstr_tok: ["The","dataloader","benchmark","class",".","It","will","be","statistical","inference","FPS","and","CPU","memory","information",".","Args",":","cfg","(","mmengine.Config",")",":","config",".","distributed","(","bool",")",":","distributed","testing","flag",".","dataset_type","(","str",")",":","benchmark","data","type",",","only","supports","``","train","``",",","``","val","``","and","``","test","``",".","max_iter","(","int",")",":","maximum","iterations","of","benchmark",".","Defaults","to","2000.","log_interval","(","int",")",":","interval","of","logging",".","Defaults","to","50.","num_warmup","(","int",")",":","Number","of","Warmup",".","Defaults","to","5.","logger","(","MMLogger",",","optional",")",":","Formatted","logger","used","to","record","messages","."]
docstr: Executes the benchmark once.
docstr_tok: ["Executes","the","benchmark","once","."]
code: def run_once(self) -> dict:
      """Executes the benchmark once."""
      pure_inf_time = 0
      fps = 0
  
      # benchmark with 2000 image and take the average
      start_time = time.perf_counter()
      for i, data in enumerate(self.data_loader):
          elapsed = time.perf_counter() - start_time
  
          if (i + 1) % self.log_interval == 0:
              print_log(
                  "==================================", self.logger
              )
  
          if i >= self.num_warmup:
              pure_inf_time += elapsed
              if (i + 1) % self.log_interval == 0:
                  fps = (i + 1 - self.num_warmup) / pure_inf_time
  
                  print_log(
                      f"Done batch [{i + 1:<3}/{self.max_iter}], "
                      f"fps: {fps:.1f} batch/s, "
                      f"times per batch: {1000 / fps:.1f} ms/batch, "
                      f"batch size: {self.batch_size}, num_workers: "
                      f"{self.num_workers}",
                      self.logger,
                  )
                  print_process_memory(self._process, self.logger)
  
          if (i + 1) == self.max_iter:
              fps = (i + 1 - self.num_warmup) / pure_inf_time
              break
  
          start_time = time.perf_counter()
  
      return {"fps": fps}
  
imports: import copy
  import time
  from functools import partial
  from typing import List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import fuse_conv_bn
  from mmengine import MMLogger
  from mmengine.config import Config
  from mmengine.device import get_max_cuda_memory
  from mmengine.dist import get_world_size
  from mmengine.runner import Runner, load_checkpoint
  from mmengine.utils.dl_utils import set_multi_processing
  from torch.nn.parallel import DistributedDataParallel
  from mmdet.registry import DATASETS, MODELS
label_desc: Use image node_id 2 for calling the DataLoaderBenchmark obj's underlying member method code with example usage: obj.run_once() and returns: dict