code: def test_cpu_t2d():
      # fmt: off
      @T.prim_func
      def t2d_0(inputs: T.Buffer((1, 4, 4, 512), "float32"), weight: T.Buffer((4, 4, 512, 256), "float32"), conv2d_transpose_nhwc: T.Buffer((1, 8, 8, 256), "float32")) -> None:
          T.func_attr({"global_symbol": "main", "tir.noalias": T.bool(True)})
          with T.block("root"):
              T.reads()
              T.writes()
              T.block_attr({"meta_schedule.parallel": 288, "meta_schedule.unroll_explicit": 64, "meta_schedule.vectorize": 64})
              PadInput = T.alloc_buffer((1, 6, 6, 512))
              conv2d_transpose_nhwc_global = T.alloc_buffer((1, 8, 8, 256))
              for i0, i1, i2, i3 in T.grid(1, 6, 6, 512):
                  with T.block("PadInput"):
                      v_i0, v_i1, v_i2, v_i3 = T.axis.remap("SSSS", [i0, i1, i2, i3])
                      T.reads(inputs[v_i0, v_i1 - 1, v_i2 - 1, v_i3])
                      T.writes(PadInput[v_i0, v_i1, v_i2, v_i3])
                      PadInput[v_i0, v_i1, v_i2, v_i3] = T.if_then_else(1 <= v_i1 and v_i1 < 5 and 1 <= v_i2 and v_i2 < 5, inputs[v_i0, v_i1 - 1, v_i2 - 1, v_i3], T.float32(0))
              for n_0, h_0, w_0, co_0, n_1, h_1, w_1, co_1 in T.grid(1, 1, 2, 8, 1, 4, 1, 4):
                  for rh_0, rw_0, rc_0, n_2, h_2, w_2, co_2, rh_1, rw_1, rc_1, n_3, h_3, w_3, co_3 in T.grid(2, 2, 64, 1, 1, 1, 1, 2, 2, 8, 1, 2, 4, 8):
                      with T.block("conv2d_transpose_nhwc"):
                          v_n = T.axis.spatial(1, n_0 + n_1 + n_2 + n_3)
                          v_h = T.axis.spatial(8, h_0 * 8 + h_1 * 2 + h_2 * 2 + h_3)
                          v_w = T.axis.spatial(8, w_0 * 4 + w_1 * 4 + w_2 * 4 + w_3)
                          v_co = T.axis.spatial(256, co_0 * 32 + co_1 * 8 + co_2 * 8 + co_3)
                          v_rh = T.axis.reduce(4, rh_0 * 2 + rh_1)
                          v_rw = T.axis.reduce(4, rw_0 * 2 + rw_1)
                          v_rc = T.axis.reduce(512, rc_0 * 8 + rc_1)
                          T.reads(PadInput[v_n, (v_h + v_rh) // 2, (v_w + v_rw) // 2, v_rc], weight[3 - v_rh, 3 - v_rw, v_rc, v_co])
                          T.writes(conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co])
                          T.block_attr({"meta_schedule.tiling_structure": "SSRSRS"})
                          with T.init():
                              conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] = T.float32(0)
                          conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] = conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] + T.if_then_else((v_h + v_rh) % 2 == 0 and (v_w + v_rw) % 2 == 0, PadInput[v_n, (v_h + v_rh) // 2, (v_w + v_rw) // 2, v_rc], T.float32(0)) * weight[3 - v_rh, 3 - v_rw, v_rc, v_co]
                  for ax0, ax1, ax2, ax3 in T.grid(1, 2, 4, 8):
                      with T.block("conv2d_transpose_nhwc_global"):
                          v0 = T.axis.spatial(1, ax0)
                          v1 = T.axis.spatial(8, h_1 * 2 + ax1)
                          v2 = T.axis.spatial(8, w_0 * 4 + ax2)
                          v3 = T.axis.spatial(256, co_0 * 32 + co_1 * 8 + ax3)
                          T.reads(conv2d_transpose_nhwc_global[v0, v1, v2, v3])
                          T.writes(conv2d_transpose_nhwc[v0, v1, v2, v3])
                          conv2d_transpose_nhwc[v0, v1, v2, v3] = conv2d_transpose_nhwc_global[v0, v1, v2, v3]
      @T.prim_func
      def t2d_1(inputs: T.Buffer((1, 4, 4, 512), "float32"), weight: T.Buffer((4, 4, 512, 256), "float32"), conv2d_transpose_nhwc: T.Buffer((1, 8, 8, 256), "float32")) -> None:
          T.func_attr({"global_symbol": "main", "tir.noalias": T.bool(True)})
          with T.block("root"):
              T.reads()
              T.writes()
              T.block_attr({"meta_schedule.parallel": 288, "meta_schedule.unroll_explicit": 64, "meta_schedule.vectorize": 64})
              PadInput = T.alloc_buffer((1, 6, 6, 512))
              conv2d_transpose_nhwc_global = T.alloc_buffer((1, 8, 8, 256))
              for n_0, h_0, w_0, co_0 in T.grid(1, 1, 2, 8):
                  for ax0, ax1, ax2, ax3 in T.grid(1, 6, 4, 512):
                      with T.block("PadInput"):
                          v_i0, v_i1 = T.axis.remap("SS", [ax0, ax1])
                          v_i2 = T.axis.spatial(6, w_0 * 2 + ax2)
                          v_i3 = T.axis.spatial(512, ax3)
                          T.reads(inputs[v_i0, v_i1 - 1, v_i2 - 1, v_i3])
                          T.writes(PadInput[v_i0, v_i1, v_i2, v_i3])
                          PadInput[v_i0, v_i1, v_i2, v_i3] = T.if_then_else(1 <= v_i1 and v_i1 < 5 and 1 <= v_i2 and v_i2 < 5, inputs[v_i0, v_i1 - 1, v_i2 - 1, v_i3], T.float32(0))
                  for n_1, h_1, w_1, co_1, rh_0, rw_0, rc_0, n_2, h_2, w_2, co_2, rh_1, rw_1, rc_1, n_3, h_3, w_3, co_3 in T.grid(1, 4, 1, 4, 2, 2, 64, 1, 1, 1, 1, 2, 2, 8, 1, 2, 4, 8):
                      with T.block("conv2d_transpose_nhwc"):
                          v_n = T.axis.spatial(1, n_0 + n_1 + n_2 + n_3)
                          v_h = T.axis.spatial(8, h_0 * 8 + h_1 * 2 + h_2 * 2 + h_3)
                          v_w = T.axis.spatial(8, w_0 * 4 + w_1 * 4 + w_2 * 4 + w_3)
                          v_co = T.axis.spatial(256, co_0 * 32 + co_1 * 8 + co_2 * 8 + co_3)
                          v_rh = T.axis.reduce(4, rh_0 * 2 + rh_1)
                          v_rw = T.axis.reduce(4, rw_0 * 2 + rw_1)
                          v_rc = T.axis.reduce(512, rc_0 * 8 + rc_1)
                          T.reads(PadInput[v_n, (v_h + v_rh) // 2, (v_w + v_rw) // 2, v_rc], weight[3 - v_rh, 3 - v_rw, v_rc, v_co])
                          T.writes(conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co])
                          T.block_attr({"meta_schedule.tiling_structure": "SSRSRS"})
                          with T.init():
                              conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] = T.float32(0)
                          conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] = conv2d_transpose_nhwc_global[v_n, v_h, v_w, v_co] + T.if_then_else((v_h + v_rh) % 2 == 0 and (v_w + v_rw) % 2 == 0, PadInput[v_n, (v_h + v_rh) // 2, (v_w + v_rw) // 2, v_rc], T.float32(0)) * weight[3 - v_rh, 3 - v_rw, v_rc, v_co]
                  for ax0, ax1, ax2, ax3 in T.grid(1, 8, 4, 32):
                      with T.block("conv2d_transpose_nhwc_global"):
                          v0, v1 = T.axis.remap("SS", [ax0, ax1])
                          v2 = T.axis.spatial(8, w_0 * 4 + ax2)
                          v3 = T.axis.spatial(256, co_0 * 32 + ax3)
                          T.reads(conv2d_transpose_nhwc_global[v0, v1, v2, v3])
                          T.writes(conv2d_transpose_nhwc[v0, v1, v2, v3])
                          conv2d_transpose_nhwc[v0, v1, v2, v3] = conv2d_transpose_nhwc_global[v0, v1, v2, v3]
      @T.prim_func
      def t2d_2(inputs: T.Buffer((1, 4, 4, 512), "float32"), weight: T.Buffer((4, 4, 512, 256), "float32"), conv2d_transpose_nhwc: T.Buffer((1, 8, 8, 256), "float32")) -> None:
          T.func_attr({"global_symbol": "main", "tir.noalias": T.bool(True)})
          with T.block("root"):
              T.reads()
              T.writes()
              T.block_attr({"meta_schedule.parallel": 288, "meta_schedule.unroll_explicit": 512, "meta_schedule.vectorize": 64})
              for n_0, h_0, w_0, co_0, n_1, h_1, w_1, co_1, rh_0, rw_0, rc_0, n_2, h_2, w_2, co_2, rh_1, rw_1, rc_1, n_3, h_3, w_3, co_3 in T.grid(1, 1, 2, 8, 1, 4, 1, 4, 2, 2, 64, 1, 1, 1, 1, 2, 2, 8, 1, 2, 4, 8):
                  with T.block("conv2d_transpose_nhwc"):
                      v_n = T.axis.spatial(1, n_0 + n_1 + n_2 + n_3)
                      v_h = T.axis.spatial(8, h_0 * 8 + h_1 * 2 + h_2 * 2 + h_3)
                      v_w = T.axis.spatial(8, w_0 * 4 + w_1 * 4 + w_2 * 4 + w_3)
                      v_co = T.axis.spatial(256, co_0 * 32 + co_1 * 8 + co_2 * 8 + co_3)
                      v_rh = T.axis.reduce(4, rh_0 * 2 + rh_1)
                      v_rw = T.axis.reduce(4, rw_0 * 2 + rw_1)
                      v_rc = T.axis.reduce(512, rc_0 * 8 + rc_1)
                      T.reads(inputs[v_n, (v_h + v_rh) // 2 - 1, (v_w + v_rw) // 2 - 1, v_rc], weight[3 - v_rh, 3 - v_rw, v_rc, v_co])
                      T.writes(conv2d_transpose_nhwc[v_n, v_h, v_w, v_co])
                      T.block_attr({"meta_schedule.tiling_structure": "SSRSRS"})
                      with T.init():
                          conv2d_transpose_nhwc[v_n, v_h, v_w, v_co] = T.float32(0)
                      conv2d_transpose_nhwc[v_n, v_h, v_w, v_co] = conv2d_transpose_nhwc[v_n, v_h, v_w, v_co] + T.if_then_else((v_h + v_rh) % 2 == 0 and (v_w + v_rw) % 2 == 0, T.if_then_else(1 <= (v_h + v_rh) // 2 and (v_h + v_rh) // 2 < 5 and 1 <= (v_w + v_rw) // 2 and (v_w + v_rw) // 2 < 5, inputs[v_n, (v_h + v_rh) // 2 - 1, (v_w + v_rw) // 2 - 1, v_rc], T.float32(0)), T.float32(0)) * weight[3 - v_rh, 3 - v_rw, v_rc, v_co]
      # fmt: on
      decision_0 = [
          ("SamplePerfectTile", [1, 1, 1, 1]),
          ("SamplePerfectTile", [1, 4, 1, 2]),
          ("SamplePerfectTile", [2, 1, 1, 4]),
          ("SamplePerfectTile", [8, 4, 1, 8]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [64, 8]),
          ("SampleCategorical", 2),
          ("SampleComputeLocation", -1),
      ]
      decision_1 = [
          ("SamplePerfectTile", [1, 1, 1, 1]),
          ("SamplePerfectTile", [1, 4, 1, 2]),
          ("SamplePerfectTile", [2, 1, 1, 4]),
          ("SamplePerfectTile", [8, 4, 1, 8]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [64, 8]),
          ("SampleCategorical", 2),
          ("SampleComputeLocation", 3),
      ]
      decision_2 = [
          ("SamplePerfectTile", [1, 1, 1, 1]),
          ("SamplePerfectTile", [1, 4, 1, 2]),
          ("SamplePerfectTile", [2, 1, 1, 4]),
          ("SamplePerfectTile", [8, 4, 1, 8]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [2, 2]),
          ("SamplePerfectTile", [64, 8]),
          ("SampleCategorical", 3),
          ("SampleComputeLocation", -2),
      ]
      mod = create_te_workload("T2D", 0)
      actual = _design_space(mod)
      check_sketches(
          mod,
          sketches=actual,
          expected_mods=[t2d_0, t2d_1, t2d_2],
          expected_decisions=[decision_0, decision_1, decision_2],
          debug_mask=0,
      )
  
file_path: tvm/tests/python/meta_schedule/test_meta_schedule_space_cpu.py
imports: from tvm import meta_schedule
  from tvm.meta_schedule.testing.space_generation import check_sketches, print_sketches, generate_design_space
  from tvm.meta_schedule.testing.te_workload import create_te_workload
  from tvm.script import tir
  from tvm.target import Target
label_desc: Use image node_id 11 for calling a global function with example usage: test_cpu_t2d() without return types