code: def test_pad_shape(self):
      processor = DetDataPreprocessor()
      data = dict(inputs=torch.randint(0, 256, (2, 3, 10, 15)))
      batch_pad_shape = processor._get_pad_shape(data)
      self.assertEqual(batch_pad_shape, [(10, 15), (10, 15)])
  
      data = dict(inputs=[torch.randint(0, 256, (3, 11, 10))])
      self.assertEqual(processor._get_pad_shape(data), [(11, 10)])
  
      # batch with different image sizes
      data = dict(
          inputs=[
              torch.randint(0, 256, (3, 10, 16)),
              torch.randint(0, 256, (3, 15, 20)),
          ]
      )
  
      self.assertEqual(
          processor._get_pad_shape(data), [(10, 16), (15, 20)]
      )
  
      # test with pad divisor
      processor = DetDataPreprocessor(pad_size_divisor=10)
      data = dict(inputs=torch.randint(0, 256, (2, 3, 52, 65)))
      self.assertAlmostEqual(
          processor._get_pad_shape(data), [(60, 70), (60, 70)]
      )
  
file_path: mmdetection/tests/test_models/test_data_preprocessors/test_data_preprocessor.py
imports: from unittest import TestCase
  import torch
  from mmengine.logging import MessageHub
  from mmdet.models.data_preprocessors import BatchFixedSizePad, BatchSyncRandomResize, DetDataPreprocessor, MultiBranchDataPreprocessor
  from mmdet.structures import DetDataSample
  from mmdet.testing import demo_mm_inputs
label_desc: Use image node_id 2 for calling the TestDetDataPreprocessor obj's underlying member method code with example usage: obj.test_pad_shape() without return types