code: def test_ramp():
      target = "metal"
  
      @tvm.script.ir_module
      class IRModule:
          @T.prim_func
          def main(A: T.Buffer((1, 2), "int32")):
              T.func_attr({"global_symbol": "main"})
              for i in T.thread_binding(1, thread="threadIdx.x"):
                  with T.block("block"):
                      tx = T.axis.spatial(1, i)
                      r = T.ramp(tx, 3, 2)
                      A[0, T.ramp(0, 1, 2)] = r
  
      f = tvm.build(IRModule, target=target)
      dev = tvm.metal()
      a_nd = tvm.nd.empty((1, 2), "int32", dev)
      f(a_nd)
      assert tuple(a_nd.numpy()[0, :]) == (0, 3)
  
file_path: tvm/tests/python/codegen/test_target_codegen_metal.py
imports: import numpy
  import tvm
  import tvm.script
  import tvm.testing
  from tvm import te
  from tvm.script import tir
label_desc: Use image node_id 4 for calling a global function with example usage: test_ramp() without return types