code: def verify_gather_nd(src_shape, indices_src, indices_dtype):
      src_dtype = "float32"
      indices_src = np.array(indices_src, dtype=indices_dtype)
      A = te.placeholder(shape=src_shape, dtype=src_dtype, name="A")
      indices = te.placeholder(
          shape=indices_src.shape, dtype=indices_dtype, name="indices"
      )
      out_tensor = topi.gather_nd(a=A, indices=indices)
  
      def check_device(target, dev):
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s = tvm.topi.testing.get_injective_schedule(target)(
                  out_tensor
              )
  
          func = tvm.build(
              s, [A, indices, out_tensor], target, name="take"
          )
          shape_size = 1
          for i in range(len(src_shape)):
              shape_size = shape_size * src_shape[i]
          data_npy = np.arange(shape_size, dtype=src_dtype).reshape(
              (src_shape)
          )
          out_npys = tvm.topi.testing.gather_nd_python(
              data_npy, indices_src
          )
  
          data_nd = tvm.nd.array(data_npy, dev)
          indices_nd = tvm.nd.array(indices_src, dev)
          out_nd = tvm.nd.empty(
              out_npys.shape, device=dev, dtype=src_dtype
          )
          func(data_nd, indices_nd, out_nd)
          tvm.testing.assert_allclose(out_nd.numpy(), out_npys)
  
      for target, dev in tvm.testing.enabled_targets():
          check_device(target, dev)
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  from tvm import topi
  from tvm import relay
  import tvm.topi.testing
  from tvm.contrib.nvcc import have_fp16
  import tvm.testing
label_desc: Use image node_id 17 for calling a global function with example usage: verify_gather_nd(src_shape, indices_src, indices_dtype) without return types