code: def test_tensor_compute2():
      M = 2048
      N = 1024
      L = 1024
      factor = 16
      factor1 = 32
      factor2 = 32
      dtype = "float32"
  
      def intrin_gemm(m, n, l):
          k = te.reduce_axis((0, l))
          x = te.placeholder((m, l))
          y = te.placeholder((n, l))
          # in theory, no relation
          z = te.compute(
              (m, n), lambda i, j: te.sum(x[i][k] * y[j][k], axis=k)
          )
  
          def intrin_func(ins, outs):
              x_ptr = ins[0].access_ptr("r")
              y_ptr = ins[1].access_ptr("r")
              z_ptr = outs[0].access_ptr("w")
              body = tvm.tir.call_packed(
                  "gemv", x_ptr, y_ptr, z_ptr, m, n, l
              )
              reset = tvm.tir.call_packed("fill_zero", z_ptr, m, n)
              update = tvm.tir.call_packed(
                  "gemv_add", x_ptr, y_ptr, z_ptr, m, n, l
              )
              return body, reset, update
  
          return te.decl_tensor_intrin(
              z.op,
              intrin_func,
              default_buffer_params={"offset_factor": n},
          )
  
      vgemm = intrin_gemm(factor1, factor2, factor)
  
      A = te.placeholder(
          (M // factor1, L // factor, factor1, factor),
          name="A",
          dtype=dtype,
      )
      B = te.placeholder(
          (N // factor2, L // factor, factor2, factor),
          name="B",
          dtype=dtype,
      )
      k = te.reduce_axis((0, L // factor), name="k")
      C = te.compute(
          (M // factor1, N // factor2, factor1, factor2),
          lambda i, j: vgemm(
              A[i, k, 0:factor1, 0:factor],
              B[j, k, 0:factor2, 0:factor],
              reduce_axis=k,
          ),
      )
  
      s = te.create_schedule(C.op)
      # check lowering with the CSE pass disabled as otherwise it would do some commoning
      with tvm.transform.PassContext(
          opt_level=3, disabled_pass=["tir.CommonSubexprElimTIR"]
      ):
          stmt = tvm.lower(s, [A, B, C])["main"].body
      assert isinstance(stmt.body.body[0], tvm.tir.Evaluate)
      assert isinstance(stmt.body.body[1].body, tvm.tir.Evaluate)
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.topi.nn.pooling import pool2d
label_desc: Use image node_id 11 for calling a global function with example usage: test_tensor_compute2() and returns: te, body,  reset,  update