code: def verify_pool_grad(
      n,
      ic,
      ih,
      kh,
      sh,
      padding,
      pool_type,
      ceil_mode,
      count_include_pad=True,
      add_relu=False,
  ):
      """verify function of pool_grad"""
      iw = ih
      kw = kh
      sw = sh
      pt, pl, pb, pr = padding
      A = te.placeholder((n, ic, ih, iw), name="A")
      B = topi.nn.pool2d(
          A,
          kernel=[kh, kw],
          stride=[sh, sw],
          dilation=[1, 1],
          padding=padding,
          pool_type=pool_type,
          ceil_mode=ceil_mode,
          layout="NCHW",
          count_include_pad=count_include_pad,
      )
      dtype = A.dtype
  
      bshape = get_const_tuple(B.shape)
      ashape = get_const_tuple(A.shape)
      if ceil_mode:
          assert bshape[2] == int(
              math.ceil(float(ashape[2] - kh + pt + pb) / sh) + 1
          )
          assert bshape[3] == int(
              math.ceil(float(ashape[3] - kw + pl + pr) / sw) + 1
          )
      else:
          assert bshape[2] == int(
              math.floor(float(ashape[2] - kh + pt + pb) / sh) + 1
          )
          assert bshape[3] == int(
              math.floor(float(ashape[3] - kw + pl + pr) / sw) + 1
          )
      OutGrad = te.placeholder(bshape, name="OutGrad")
      PoolGrad = topi.nn.pool_grad(
          OutGrad,
          A,
          kernel=[kh, kw],
          stride=[sh, sw],
          padding=padding,
          pool_type=pool_type,
          ceil_mode=ceil_mode,
          layout="NCHW",
          count_include_pad=count_include_pad,
      )
      if add_relu:
          PoolGrad = topi.nn.relu(PoolGrad)
  
      a_np = np.random.uniform(low=0.001, size=(n, ic, ih, iw)).astype(
          dtype
      )
      out_grad_np = np.random.uniform(low=0.001, size=bshape).astype(
          dtype
      )
      pool_grad_np = tvm.topi.testing.pool_grad_nchw(
          a_np,
          out_grad_np,
          pool_size=(kh, kw),
          strides=(sh, sw),
          padding=padding,
          pool_type=pool_type,
          ceil_mode=ceil_mode,
          count_include_pad=count_include_pad,
      )
      if add_relu:
          pool_grad_np = np.maximum(pool_grad_np, 0.0)
  
      def check_target(target, dev):
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s_func = tvm.topi.testing.dispatch(
                  target, _pool_grad_schedule
              )
              s = s_func(PoolGrad)
  
          a = tvm.nd.array(a_np, dev)
          out_grad = tvm.nd.array(out_grad_np, dev)
          pool_grad = tvm.nd.array(
              np.zeros(get_const_tuple(PoolGrad.shape), dtype=dtype),
              dev,
          )
          f = tvm.build(s, [A, OutGrad, PoolGrad], target)
          f(a, out_grad, pool_grad)
          tvm.testing.assert_allclose(
              pool_grad.numpy(), pool_grad_np, rtol=1e-5
          )
  
      for target, dev in tvm.testing.enabled_targets():
          check_target(target, dev)
  
imports: import math
  import pytest
  import numpy
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import te, topi, TVMError
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 1 for calling a global function with example usage: verify_pool_grad(n, ic, ih, kh, sh, padding, pool_type, ceil_mode, count_include_pad, add_relu) without return types