code: def verify_gather(data, axis, indices):
      data = np.asarray(data)
      indices = np.asarray(indices)
  
      var_data = te.placeholder(
          shape=data.shape, dtype=data.dtype.name, name="data"
      )
      var_indices = te.placeholder(
          shape=indices.shape, dtype=indices.dtype.name, name="indices"
      )
      out_tensor = topi.gather(var_data, axis, var_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,
              [var_data, var_indices, out_tensor],
              target,
              name="gather",
          )
          out_npys = tvm.topi.testing.gather_python(data, axis, indices)
  
          data_nd = tvm.nd.array(data, dev)
          indices_nd = tvm.nd.array(indices, dev)
          out_nd = tvm.nd.empty(
              out_npys.shape, device=dev, dtype=data.dtype.name
          )
          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 16 for calling a global function with example usage: verify_gather(data, axis, indices) without return types