code: def test_adaptive_pooling(num_filter, output_size, stype, shape):
      data_tmp = mx.nd.random.uniform(shape=shape)
      data = mx.sym.var("data", stype=stype)
      in_channels = shape[1]
  
      data = mx.sym.Convolution(
          data=data, kernel=(3, 3), pad=(1, 1), num_filter=num_filter
      )
      data = mx.sym.contrib.AdaptiveAvgPooling2D(
          data=data, output_size=output_size
      )
  
      weight_tmp = np.random.normal(
          -0.1, 0.1, size=(num_filter, in_channels, 3, 3)
      )
      bias_tmp = np.random.normal(0.1, 0.1, size=(num_filter,))
  
      in_location = [
          mx.nd.array(data_tmp).tostype(stype),
          mx.nd.array(weight_tmp).tostype(stype),
          mx.nd.array(bias_tmp).tostype(stype),
      ]
  
      check_numeric_gradient(
          data, in_location, numeric_eps=1e-2, rtol=0.16, atol=1e-4
      )
  
imports: import sys
  import os
  import numpy
  import mxnet
  import pytest
  from mxnet.test_utils import rand_ndarray, assert_almost_equal
  from mxnet import gluon, context, use_np
  from mxnet.gluon import nn
  from mxnet.test_utils import *
  import itertools
label_desc: Use image node_id 13 for calling a global function with example usage: test_adaptive_pooling(num_filter, output_size, stype, shape) without return types