code: def test_compute_metrics(self):
      temp_dir = tempfile.TemporaryDirectory()
      path = osp.join(temp_dir.name, "results.pkl")
      metric = DumpDetResults(out_file_path=path)
      data_samples = [dict(data=(Tensor([1, 2, 3]), Tensor([4, 5, 6])))]
      metric.process(None, data_samples)
      metric.compute_metrics(metric.results)
      self.assertTrue(osp.isfile(path))
  
      results = load(path)
      self.assertEqual(len(results), 1)
      self.assertEqual(
          results[0]["data"][0].device, torch.device("cpu")
      )
  
      temp_dir.cleanup()
  
file_path: mmdetection/tests/test_evaluation/test_metrics/test_dump_det_results.py
imports: import os.path
  import tempfile
  from unittest import TestCase
  import torch
  from mmengine.fileio import load
  from torch import Tensor
  from mmdet.evaluation import DumpDetResults
  from mmdet.structures.mask import encode_mask_results
label_desc: Use image node_id 3 for calling the TestDumpResults obj's underlying member method code with example usage: obj.test_compute_metrics() without return types