code: def compute_tir_conv2d_nchw_oihw(data_shape, weight_shape, dtype):
      assert dtype == "float32"
      OC, IC, FH, FW = weight_shape
  
      padding = (0, 0, 0, 0)
      strides = (1, 1)
      dilation = (1, 1)
      output_shape = (
          data_shape[0],
          weight_shape[0],
          (
              data_shape[2]
              - ((weight_shape[2] - 1) * dilation[0] + 1)
              + padding[0]
              + padding[1]
          )
          // strides[0]
          + 1,
          (
              data_shape[3]
              - ((weight_shape[3] - 1) * dilation[1] + 1)
              + padding[2]
              + padding[3]
          )
          // strides[1]
          + 1,
      )
      N, K, BH, BW = output_shape
  
      # fmt: off
      @T.prim_func
      def conv2d(a: T.handle, filt: T.handle, b: T.handle) -> None:
          T.func_attr({"global_symbol": "main", "tir.noalias": True})
          A = T.match_buffer(a, data_shape, dtype=dtype)
          Filter = T.match_buffer(filt, weight_shape, dtype=dtype)
          B = T.match_buffer(b, output_shape, dtype=dtype)
          for n, k, bh, bw in T.grid(N, K, BH, BW):
              with T.block("init"):
                  vn, vk, vbh, vbw = T.axis.remap("SSSS", [n, k, bh, bw])
                  B[vn, vk, vbh, vbw] = T.float32(0)
              for ic, fh, fw in T.grid(IC, FH, FW):
                  with T.block("update"):
                      vn, vk, vbh, vbw, vc, vfh, vfw = T.axis.remap("SSSSRRR", [n, k, bh, bw, ic, fh, fw])
                      B[vn, vk, vbh, vbw] = B[vn, vk, vbh, vbw] + A[vn, vc, vbh + vfh, vbw + vfw] * Filter[vk, vc, vfh, vfw]
      # fmt: on
  
      return conv2d
  
file_path: tvm/tests/python/meta_schedule/test_meta_schedule_relay_tir_compute.py
imports: import numpy
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import autotvm
  from tvm import meta_schedule
  from tvm import relay, te
  from tvm.relay.testing.temp_op_attr import TempOpAttr
  from tvm.script import tir
label_desc: Use image node_id 1 for calling a global function with example usage: compute_tir_conv2d_nchw_oihw(data_shape, weight_shape, dtype) and returns: conv2d