code: def test_schedule():
      @script
      def outer_product(a, b):
          c = output_tensor((64, 64), a.dtype)
          for i in range(64):
              for j in range(64):
                  c[i, j] = a[i] * b[j]
          return c
  
      a = te.placeholder((64,), name="a", dtype="float32")
      b = te.placeholder((64,), name="b", dtype="float32")
      c = outer_product(a, b)
  
      # Test perfect loop split
      # Test loop reorder
      # Test loop annotation
      sch = te.create_schedule(c.op)
      i, j = c.op.axis
      io, ii = sch[c].split(i, 4)
      sch[c].parallel(ii)
      jo, ji = sch[c].split(j, 4)
      joo, joi = sch[c].split(jo, 4)
      sch[c].vectorize(ji)
      sch[c].reorder(ii, io, joo, joi, ji)
      ir = tvm.lower(sch, [a, b, c])["main"].body
      assert isinstance(ir, tvm.tir.AttrStmt)
      ir = ir.body
      assert isinstance(ir, tvm.tir.For)
      assert ir.loop_var.name == "i.inner"
      ir = ir.body
      assert isinstance(ir, tvm.tir.For)
      assert ir.loop_var.name == "i.outer"
      ir = ir.body
      assert isinstance(ir, tvm.tir.For)
      assert ir.loop_var.name == "j.outer.outer"
      ir = ir.body
      assert isinstance(ir, tvm.tir.For)
      assert ir.loop_var.name == "j.outer.inner"
      ir = ir.body
      func, ins, outs = run_and_check(
          outer_product, [a, b], sch=sch, outs=[c]
      )
      run_and_check(func, ins, outs=outs)
  
      # Test fuse
      sch = te.create_schedule(c.op)
      sch[c].fuse(c.op.axis[0], c.op.axis[1])
      ir = tvm.lower(sch, [a, b, c])["main"].body
      assert isinstance(ir, tvm.tir.AttrStmt)
      ir = ir.body
      assert isinstance(ir, tvm.tir.For)
      assert ir.loop_var.name == "i.j.fused"
      func, ins, outs = run_and_check(
          outer_product, [a, b], sch=sch, outs=[c]
      )
      run_and_check(func, ins, outs=outs)
  
      # Test imperfect loop split
      sch = te.create_schedule(c.op)
      sch[c].split(c.op.axis[0], 3)
      ir = tvm.lower(sch, [a, b, c], simple_mode=True)
      func, ins, outs = run_and_check(
          outer_product, [a, b], sch=sch, outs=[c]
      )
      run_and_check(func, ins, outs=outs)
  
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 18 for calling a global function with example usage: test_schedule() and returns: c