code: def verify_one_hot(
      indices_shape, depth, on_value, off_value, axis, dtype
  ):
      indices = te.placeholder(
          shape=indices_shape, name="indices", dtype="int32"
      )
      on_value_const = tvm.tir.const(on_value, dtype)
      off_value_const = tvm.tir.const(off_value, dtype)
      one_hot_result = topi.transform.one_hot(
          indices, on_value_const, off_value_const, depth, axis, dtype
      )
  
      def check_device(target, dev):
          print("Running on target: %s" % target)
          with tvm.target.Target(target):
              s = tvm.topi.testing.get_injective_schedule(target)(
                  one_hot_result
              )
          fn = tvm.build(
              s, [indices, one_hot_result], target, name="one_hot"
          )
          indices_npy = np.random.randint(
              0, depth, size=indices_shape
          ).astype(indices.dtype)
          out_npy = tvm.topi.testing.one_hot(
              indices_npy, on_value, off_value, depth, axis, dtype
          )
          indices_nd = tvm.nd.array(indices_npy, dev)
          out_nd = tvm.nd.array(
              np.empty(out_npy.shape).astype(one_hot_result.dtype), dev
          )
          fn(indices_nd, out_nd)
          out_topi = out_nd.numpy()
          tvm.testing.assert_allclose(out_topi, out_npy)
  
      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 22 for calling a global function with example usage: verify_one_hot(indices_shape, depth, on_value, off_value, axis, dtype) without return types