code: def conv2d_nhwc_reindex_weight(
      var_inputs: T.handle,
      var_weight: T.handle,
      var_conv2d_nhwc: T.handle,
  ) -> None:
      inputs = T.match_buffer(
          var_inputs, [1, 224, 224, 3], dtype="float32"
      )
      weight = T.match_buffer(
          var_weight, [7, 7, 3, 64], dtype="float32"
      )
      conv2d_nhwc = T.match_buffer(
          var_conv2d_nhwc, [1, 112, 112, 64], dtype="float32"
      )
      PadInput = T.alloc_buffer([1, 230, 230, 3], dtype="float32")
      weight_reindex = T.alloc_buffer([64, 7, 7, 3], dtype="float32")
      for i0, i1, i2, i3 in T.grid(1, 230, 230, 3):
          with T.block("PadInput"):
              i0_1, i1_1, i2_1, i3_1 = T.axis.remap(
                  "SSSS", [i0, i1, i2, i3]
              )
              T.reads(inputs[i0_1, i1_1 - 3, i2_1 - 3, i3_1])
              T.writes(PadInput[i0_1, i1_1, i2_1, i3_1])
              PadInput[i0_1, i1_1, i2_1, i3_1] = T.if_then_else(
                  i1_1 >= 3 and i1_1 < 227 and i2_1 >= 3 and i2_1 < 227,
                  inputs[i0_1, i1_1 - 3, i2_1 - 3, i3_1],
                  T.float32(0),
                  dtype="float32",
              )
      for ax3, ax4, ax5, ax6 in T.grid(64, 7, 7, 3):
          with T.block("weight_reindex"):
              v3, v4, v5, v6 = T.axis.remap(
                  "SSSS", [ax3, ax4, ax5, ax6]
              )
              T.reads(weight[v4, v5, v6, v3])
              T.writes(weight_reindex[v3, v4, v5, v6])
              weight_reindex[v3, v4, v5, v6] = weight[v4, v5, v6, v3]
      for i0, i1, i2, i3, i4, i5, i6 in T.grid(
          1, 112, 112, 64, 7, 7, 3
      ):
          with T.block("conv2d_nhwc"):
              n, h, w, co, rh, rw, rc = T.axis.remap(
                  "SSSSRRR", [i0, i1, i2, i3, i4, i5, i6]
              )
              T.reads(
                  PadInput[
                      n, h * 2 + rh, w * 2 + rw, co // 64 * 3 + rc
                  ],
                  weight_reindex[co, rh, rw, rc],
              )
              T.writes(conv2d_nhwc[n, h, w, co])
              with T.init():
                  conv2d_nhwc[n, h, w, co] = T.float32(0)
              conv2d_nhwc[n, h, w, co] = (
                  conv2d_nhwc[n, h, w, co]
                  + PadInput[
                      n, h * 2 + rh, w * 2 + rw, co // 64 * 3 + rc
                  ]
                  * weight_reindex[co, rh, rw, rc]
              )
  
imports: import pytest
  import tvm
  import tvm.testing
  from tvm import tir
  from tvm.script import tir
  from tvm.tir.schedule.schedule import ScheduleError
  from tvm.tir.schedule.testing import assert_structural_equal_ignore_global_symbol, verify_trace_roundtrip
label_desc: Use image node_id 5 for calling a global function with example usage: conv2d_nhwc_reindex_weight(var_inputs, var_weight, var_conv2d_nhwc) without return types