code: def test_softmax():
      for shape in [(10, 4), (10, 5, 4)]:
          for dtype in ["float16", "float32"]:
              # Softmax accuracy for float16 is poor
              if dtype == "float16":
                  continue
              x = relay.var("x", shape=shape, dtype=dtype)
              y = relay.nn.softmax(x, axis=1)
              assert "nn.softmax" in y.astext()
              yy = run_infer_type(y)
              assert yy.checked_type == relay.TensorType(shape, dtype)
              func = relay.Function([x], y)
              x_data = np.random.uniform(size=shape).astype(dtype)
              ref_res = tvm.topi.testing.softmax_python(x_data, axis=1)
              for target, dev in tvm.testing.enabled_targets():
                  op_res = relay.create_executor(
                      "graph", device=dev, target=target
                  ).evaluate(func)(x_data)
                  np.testing.assert_allclose(
                      op_res.numpy(), ref_res, rtol=1e-5
                  )
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  import scipy
  from tvm import relay
  import pytest
  from tvm.relay.testing import run_infer_type
  import tvm.topi.testing
  from tvm.contrib.nvcc import have_fp16
  import tvm.testing
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 9 for calling a global function with example usage: test_softmax() without return types