code: def test_init_and_run(self):
      cfg = copy.deepcopy(self.cfg)
      dataset_benchmark = DatasetBenchmark(
          cfg,
          "train",
          self.max_iter,
          self.log_interval,
          self.num_warmup,
      )
      results = dataset_benchmark.run(1)
      self.assertTrue("avg_fps" in results)
      self.assertTrue("fps_list" in results)
      self.assertEqual(len(results["fps_list"]), 1)
  
      # test repeat
      results = dataset_benchmark.run(3)
      self.assertTrue("avg_fps" in results)
      self.assertTrue("fps_list" in results)
      self.assertEqual(len(results["fps_list"]), 3)
  
      # test test dataset
      dataset_benchmark = DatasetBenchmark(
          cfg, "test", self.max_iter, self.log_interval, self.num_warmup
      )
      dataset_benchmark.run(1)
  
      # test val dataset
      dataset_benchmark = DatasetBenchmark(
          cfg, "val", self.max_iter, self.log_interval, self.num_warmup
      )
      dataset_benchmark.run(1)
  
      # test dataset_type input parameters error
      with self.assertRaises(AssertionError):
          DatasetBenchmark(
              cfg,
              "training",
              self.max_iter,
              self.log_interval,
              self.num_warmup,
          )
  
      # test full_init
      cfg = copy.deepcopy(self.cfg)
      cfg.test_dataloader.dataset = dict(type="ToyFullInitDataset")
      dataset_benchmark = DatasetBenchmark(
          cfg,
          "train",
          self.max_iter,
          self.log_interval,
          self.num_warmup,
      )
      dataset_benchmark.run(1)
  
imports: import copy
  import os
  import tempfile
  import unittest
  import torch
  from mmengine import Config, MMLogger
  from mmengine.dataset import Compose
  from mmengine.model import BaseModel
  from torch.utils.data import Dataset
  from mmdet.registry import DATASETS, MODELS
  from mmdet.utils import register_all_modules
  from mmdet.utils.benchmark import DataLoaderBenchmark, DatasetBenchmark, InferenceBenchmark
label_desc: Use image node_id 2 for calling the TestDatasetBenchmark obj's underlying member method code with example usage: obj.test_init_and_run() without return types