code: def test_tensor_compute1():
      m = 1024
      factor = 16
      dtype = "float32"
  
      def intrin_vadd(n):
          x = te.placeholder((n,))
          y = te.placeholder((n,))
          z = te.compute(x.shape, lambda i: x[i] + y[i])
  
          def intrin_func(ins, outs):
              ib = tvm.tir.ir_builder.create()
              ib.emit(
                  tvm.tir.call_extern(
                      outs[0].dtype,
                      "vadd",
                      ins[0].access_ptr("r"),
                      ins[1].access_ptr("r"),
                      outs[0].access_ptr("wr"),
                  )
              )
              return ib.get()
  
          return te.decl_tensor_intrin(
              z.op,
              intrin_func,
              default_buffer_params={"offset_factor": n},
          )
  
      vadd = intrin_vadd(factor)
  
      A = te.placeholder((m // factor, factor), name="A", dtype=dtype)
      B = te.placeholder((m // factor, factor), name="B", dtype=dtype)
      C = te.compute(
          (m // factor, factor),
          lambda i: vadd(A[i, 0:factor], B[i, 0:factor]),
      )
  
      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, 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 10 for calling a global function with example usage: test_tensor_compute1() and returns: te, ib