code: def verify_adaptive_pool(
      dshape, out_size, pool_type, layout="NCHW", dtype="float32"
  ):
      """verify function of adaptive_pool"""
      np_data = np.random.uniform(low=0, high=255, size=dshape).astype(
          dtype
      )
      np_out = tvm.topi.testing.adaptive_pool(
          np_data, out_size, pool_type, layout
      )
      oshape = np_out.shape
  
      data = te.placeholder(dshape, name="data", dtype=dtype)
      if len(out_size) == 2:
          out = topi.nn.adaptive_pool(data, out_size, pool_type, layout)
      else:
          assert len(out_size) == 3
          out = topi.nn.adaptive_pool3d(
              data, out_size, pool_type, layout
          )
  
      def check_target(target, dev):
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s_func = tvm.topi.testing.dispatch(
                  target, _adaptive_pool_schedule
              )
              if target == "cuda":
                  s = s_func(out, layout)
              else:
                  s = s_func(out)
          a = tvm.nd.array(np_data, dev)
          b = tvm.nd.array(
              np.zeros(get_const_tuple(oshape), dtype=out.dtype), dev
          )
          f = tvm.build(s, [data, out], target)
          f(a, b)
          tvm.testing.assert_allclose(
              b.numpy(), np_out, rtol=4e-5, atol=1e-6
          )
  
      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 5 for calling a global function with example usage: verify_adaptive_pool(dshape, out_size, pool_type, layout, dtype) without return types