code: def verify_resize2d(
      batch,
      in_channel,
      in_height,
      in_width,
      out_height,
      out_width,
      layout="NCHW",
      coord_trans="align_corners",
      method="linear",
  ):
      if layout == "NCHW":
          A = te.placeholder(
              (batch, in_channel, in_height, in_width),
              name="A",
              dtype="float32",
          )
          dtype = A.dtype
          out_shape = (batch, in_channel, out_height, out_width)
          a_np = np.random.uniform(
              size=(batch, in_channel, in_height, in_width)
          ).astype(dtype)
      elif layout == "NHWC":
          A = te.placeholder(
              (batch, in_height, in_width, in_channel),
              name="A",
              dtype="float32",
          )
          dtype = A.dtype
          out_shape = (batch, out_height, out_width, in_channel)
          a_np = np.random.uniform(
              size=(batch, in_height, in_width, in_channel)
          ).astype(dtype)
      else:
          raise NotImplementedError(
              "Layout not supported {} ".format(layout)
          )
      B = topi.image.resize2d(
          A,
          [0.0] * 4,
          (out_height, out_width),
          layout=layout,
          coordinate_transformation_mode=coord_trans,
          method=method,
      )
      scale_h = out_height / in_height
      scale_w = out_width / in_width
      b_np = tvm.topi.testing.resize2d_python(
          a_np, (scale_h, scale_w), layout, method, coord_trans
      )
  
      def check_target(target, dev):
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s = tvm.topi.testing.get_injective_schedule(target)(B)
          a = tvm.nd.array(a_np, dev)
          b = tvm.nd.array(np.zeros(out_shape, dtype=dtype), dev)
          f = tvm.build(s, [A, B], target)
          f(a, b)
  
          tvm.testing.assert_allclose(
              b.numpy(), b_np, rtol=1e-3, atol=1e-3
          )
  
      for target, dev in tvm.testing.enabled_targets():
          check_target(target, dev)
  
file_path: tvm/tests/python/topi/test_topi_image.py
imports: import numpy
  import tvm
  from tvm import te
  from tvm import topi
  import tvm.testing
  import tvm.topi.testing
  from tvm.contrib.pickle_memoize import memoize
label_desc: Use image node_id 1 for calling a global function with example usage: verify_resize2d(batch, in_channel, in_height, in_width, out_height, out_width, layout, coord_trans, method) without return types