code: def test_math_intrin():
      @script
      def intrin_real(a):
          b = output_tensor((8,), "float32")
          b[0] = sqrt(a[0])
          b[1] = log(a[1])
          b[2] = exp(a[2])
          b[3] = sigmoid(a[3])
          b[4] = power(a[4], a[5])
          b[5] = tanh(a[5])
          b[6] = min(a[4], a[5])
          b[7] = max(a[5], a[6])
          return b
  
      a8 = te.placeholder((8,), dtype="float32", name="a")
      b8 = intrin_real(a8)
      sch = te.create_schedule(b8.op)
      func = tvm.build(sch, [a8, b8])
      assert func
      a = numpy.arange(2, 10).astype("float32")
      tvm_a = tvm.nd.array(a)
      tvm_b = tvm.nd.array(numpy.zeros((8,), dtype="float32"))
      b = intrin_real(a)
      func(tvm_a, tvm_b)
      tvm.testing.assert_allclose(b, tvm_b.numpy(), rtol=1e-5)
  
      @script
      def intrin_int(a):
          b = output_tensor((1,), "int32")
          b[0] = popcount(a[0])
          return b
  
      a1 = te.placeholder((1,), dtype="int32")
      b1 = intrin_int(a1)
      sch = te.create_schedule(b1.op)
      func = tvm.build(sch, [a1, b1])
      assert func
      a = numpy.array([114514]).astype("int32")
      tvm_a = tvm.nd.array(a)
      tvm_b = tvm.nd.array(numpy.array([0]).astype("int32"))
      b = intrin_int(a)
      func(tvm_a, tvm_b)
      assert tvm_b.numpy()[0] == b[0]
  
imports: import tvm, inspect, sys, traceback, numpy, pytest, types, os
  from tvm import te
  from tvm.contrib import utils
  from tvm.te.hybrid import script
  from tvm.te.hybrid.runtime import HYBRID_GLOBALS
  import tvm.testing
label_desc: Use image node_id 8 for calling a global function with example usage: test_math_intrin() and returns: b, b