code: def test_adaptive_avg_pool2d():
      # Test the empty batch dimension
      # Test the two input conditions
      x_empty = torch.randn(0, 3, 4, 5)
      # 1. tuple[int, int]
      wrapper_out = adaptive_avg_pool2d(x_empty, (2, 2))
      assert wrapper_out.shape == (0, 3, 2, 2)
      # 2. int
      wrapper_out = adaptive_avg_pool2d(x_empty, 2)
      assert wrapper_out.shape == (0, 3, 2, 2)
  
      # wrapper op with 3-dim input
      x_normal = torch.randn(3, 3, 4, 5)
      wrapper_out = adaptive_avg_pool2d(x_normal, (2, 2))
      ref_out = F.adaptive_avg_pool2d(x_normal, (2, 2))
      assert wrapper_out.shape == (3, 3, 2, 2)
      assert torch.equal(wrapper_out, ref_out)
  
      wrapper_out = adaptive_avg_pool2d(x_normal, 2)
      ref_out = F.adaptive_avg_pool2d(x_normal, 2)
      assert wrapper_out.shape == (3, 3, 2, 2)
      assert torch.equal(wrapper_out, ref_out)
  
imports: from unittest.mock import patch
  import torch
  import torch.nn
  import torch.nn.functional
  from mmdet.models.layers import AdaptiveAvgPool2d, adaptive_avg_pool2d
label_desc: Use image node_id 1 for calling a global function with example usage: test_adaptive_avg_pool2d() without return types