code: def verify_take(
      src_shape,
      indices_src,
      axis=None,
      mode="clip",
      indices_dtype="int32",
  ):
      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"
      )
      if axis is None:
          out_tensor = topi.take(a=A, indices=indices, mode=mode)
      else:
          out_tensor = topi.take(
              a=A, indices=indices, axis=axis, mode=mode
          )
  
      def check_device(target):
          dev = tvm.device(target, 0)
          if not tvm.testing.device_enabled(target):
              print("Skip because %s is not enabled" % target)
              return
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s = tvm.topi.testing.get_injective_schedule(target)(
                  out_tensor
              )
  
          foo = 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)
          )
  
          if axis is None:
              np_mode = "raise" if mode == "fast" else mode
              out_npys = np.take(data_npy, indices_src, mode=np_mode)
          else:
              np_mode = "raise" if mode == "fast" else mode
              out_npys = np.take(
                  data_npy, indices_src, axis=axis, mode=np_mode
              )
          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
          )
          foo(data_nd, indices_nd, out_nd)
          tvm.testing.assert_allclose(out_nd.numpy(), out_npys)
  
      for target in ["llvm", "opencl", "sdaccel", "aocl_sw_emu"]:
          check_device(target)
  
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 12 for calling a global function with example usage: verify_take(src_shape, indices_src, axis, mode, indices_dtype) without return types