code: def test_dnnl_pooling_avg(self):
      dev = cpu_dev
      N = 1
      C = 3
      H = 2
      W = 2
  
      data_shape = [N, C, H, W]
      param_shape = [1, C, 1, 1]
      data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  
      x0 = np.array(data, dtype=np.float32).reshape(data_shape)
      x0_ct = tensor.Tensor(device=dev, data=x0).data
  
      dy0 = np.array([1, 2, 3], dtype=np.float32).reshape([1, 3, 1, 1])
      dy0_ct = tensor.Tensor(device=dev, data=dy0).data
  
      hndl = singa_api.PoolingHandle(
          x0_ct, [2, 2], [1, 1], [0, 0], False
      )
  
      y0_ct = singa_api.CpuPoolingForward(hndl, x0_ct)
  
      y1 = np.array([[[[2.5000]], [[6.5000]], [[10.5000]]]])
      np.testing.assert_array_almost_equal(
          tensor.to_numpy(_cTensor_to_pyTensor(y0_ct)), y1
      )
      dx0_ct = singa_api.CpuPoolingBackward(hndl, dy0_ct, x0_ct, y0_ct)
      dx1 = np.array(
          [
              [
                  [[0.2500, 0.2500], [0.2500, 0.2500]],
                  [[0.5000, 0.5000], [0.5000, 0.5000]],
                  [[0.7500, 0.7500], [0.7500, 0.7500]],
              ]
          ]
      )
      np.testing.assert_array_almost_equal(
          tensor.to_numpy(_cTensor_to_pyTensor(dx0_ct)), dx1
      )
  
imports: from __future__ import division
  import unittest
  import math
  import numpy
  from singa import singa_wrap
  from singa import tensor
  from cuda_helper import gpu_dev, cpu_dev
label_desc: Use image node_id 19 for calling the TestAPI obj's underlying member method code with example usage: obj.test_dnnl_pooling_avg() without return types