code: def test_dynamic_to_static_one_hot():
      def _verify(
          indices_shape, depth, on_value, off_value, axis, dtype
      ):
          indices = relay.var(
              "indices", relay.TensorType(indices_shape, "int32")
          )
          depth_var = relay.const(depth)
          on_value_var = relay.var(
              "on_value", relay.TensorType((), "int32")
          )
          off_value_var = relay.var(
              "off_value", relay.TensorType((), "int32")
          )
          out = relay.one_hot(
              indices,
              on_value_var,
              off_value_var,
              depth_var,
              axis,
              dtype,
          )
          params = {
              "on_value": on_value,
              "off_value": off_value,
          }
  
          func = relay.Function(
              [indices, on_value_var, off_value_var], out
          )
          func2 = run_opt_pass(
              run_opt_pass(func, transform.DynamicToStatic(), params),
              transform.InferType(),
          )
  
          zz = func2.body
          assert isinstance(zz, relay.Call)
          assert zz.op == relay.op.get("one_hot")
  
          indices_np = np.random.randint(
              0, depth, size=indices_shape
          ).astype("int32")
          out_np = tvm.topi.testing.one_hot(
              indices_np, on_value, off_value, depth, axis, dtype
          )
          verify_func(func2, [indices_np], out_np)
  
      _verify((3,), 3, 1, 0, -1, "int32")
      _verify((3,), 3, 1.0, 0.0, -1, "float32")
      _verify((2, 2), 5, 2, -2, 0, "int32")
      _verify((2, 2), 5, 0.5, -0.5, 1, "float32")
      _verify((3, 2, 4, 5), 6, 1, 0, 1, "int32")
      _verify((3, 2, 4, 5), 6, 1.0, 0.0, 0, "float32")
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.build_module import bind_params_by_name
  from tvm.relay.testing import run_infer_type, create_workload
  import tvm.topi.testing
  import tvm.testing
label_desc: Use image node_id 12 for calling a global function with example usage: test_dynamic_to_static_one_hot() without return types