code: def test_tensor_pool():
      def intrin_pool():
          A = te.placeholder((64, 16, 16), name="A")
          kh = te.reduce_axis((0, 3), name="kh")
          kw = te.reduce_axis((0, 3), name="kw")
          P = te.compute(
              (64, 14, 14),
              lambda c, oh, ow: tvm.te.max(
                  A[c, oh + kh, ow + kw], axis=[kh, kw]
              ),
              name="p",
          )
  
          def intrin_func(ins, outs):
              dinp = ins[0]
              dout = outs[0]
              return tvm.tir.call_packed("op", dinp, dout)
  
          return te.decl_tensor_intrin(
              P.op,
              intrin_func,
              default_buffer_params={"offset_factor": 1},
          )
  
      A = te.placeholder((1, 64, 16, 16), name="A")
      P = pool2d(
          data=A,
          kernel=(3, 3),
          stride=(1, 1),
          dilation=(1, 1),
          padding=(0, 0, 0, 0),
          pool_type="max",
      )
      s = te.create_schedule(P.op)
      _, oh, _, _ = P.op.axis
      intrin = intrin_pool()
      s[P].tensorize(oh, intrin)
      tvm.lower(s, [A, P])
  
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 19 for calling a global function with example usage: test_tensor_pool() and returns: te, tvm