예제 #1
0
 def main(A: T.handle, tensor: T.handle) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     # buffer definition
     tensor_2 = T.buffer_decl([1, 10, 12, 16], dtype="int8", elem_offset=0, align=128, offset_factor=1)
     A_1 = T.match_buffer(A, [1, 12, 14, 16], dtype="int8", elem_offset=0, align=128, offset_factor=1)
     tensor_1 = T.match_buffer(tensor, [1, 8, 8, 16], dtype="int8", elem_offset=0, align=128, offset_factor=1)
     # body
     T.realize(tensor_1[0:1, 0:8, 0:8, 0:16], "")
     for ax1_outer in T.serial(0, 2):
         T.realize(tensor_2[0:1, (ax1_outer*4):((ax1_outer*4) + 6), 0:12, 0:16], "")
         T.attr(tensor_2, "rolling_buffer_scope", True)
         for ax1 in T.serial(0, 6):
             for ax2 in T.serial(0, 12):
                 for ax3 in T.serial(0, 16):
                     tensor_2[0, (ax1 + (ax1_outer*4)), ax2, ax3] = T.int8(0)
                     for dh in T.serial(0, 3):
                         for dw in T.serial(0, 3):
                             tensor_2[0, (ax1 + (ax1_outer*4)), ax2, ax3] = T.max(tensor_2[0, (ax1 + (ax1_outer*4)), ax2, ax3], A_1[0, ((ax1 + (ax1_outer*4)) + dh), (ax2 + dw), ax3])
         for ax1_inner in T.serial(0, 4):
             for ax2_inner in T.serial(0, 8):
                 for ax3_inner in T.serial(0, 16):
                     tensor_1[0, (ax1_inner + (ax1_outer*4)), ax2_inner, ax3_inner] = T.int8(0)
                     for dh_1 in T.serial(0, 3):
                         for dw_1 in T.serial(0, 5):
                             tensor_1[0, (ax1_inner + (ax1_outer*4)), ax2_inner, ax3_inner] = T.max(tensor_1[0, (ax1_inner + (ax1_outer*4)), ax2_inner, ax3_inner], tensor_2[0, ((ax1_inner + (ax1_outer*4)) + dh_1), (ax2_inner + dw_1), ax3_inner])
예제 #2
0
def scale_by_two(A: T.Buffer[(8192, ), "int8"], C: T.Buffer[(8192, ), "int8"]):
    for i in T.serial(
            0,
            8192,
    ):
        with T.block("C"):
            C[i] = A[i] * T.int8(2)
예제 #3
0
def scale_by_two(buffer_a: T.Buffer[(8192, ), "int8"],
                 buffer_c: T.Buffer[(8192, ), "int8"]):
    for i in T.serial(
            0,
            8192,
    ):
        with T.block("C"):
            buffer_c[i] = buffer_a[i] * T.int8(2)
예제 #4
0
 def pooling_decompose_3(
         x: T.Buffer[(1, 16, 225, 225), "int8"],
         tensor: T.Buffer[(1, 16, 225, 225), "int8"]) -> None:
     pad_temp = T.alloc_buffer([1, 16, 231, 231], dtype="int8")
     for i0, i2_0, i3_0 in T.grid(1, 3, 3):
         for ax0, ax1, ax2 in T.grid(16, 86, 86):
             with T.block("pad_temp_pad_const"):
                 ax0_1 = T.axis.spatial(1, 0)
                 ax1_1 = T.axis.spatial(16, ax0)
                 ax2_1 = T.axis.spatial(231, i2_0 * 80 + ax1)
                 ax3 = T.axis.spatial(231, i3_0 * 80 + ax2)
                 T.where(i2_0 * 80 + ax1 < 231 and i3_0 * 80 + ax2 < 231)
                 T.reads()
                 T.writes(pad_temp[ax0_1, ax1_1, ax2_1, ax3])
                 pad_temp[ax0_1, ax1_1, ax2_1, ax3] = T.int8(0)
         for ax0, ax1, ax2 in T.grid(16, 86, 86):
             with T.block("pad_temp"):
                 ax0_2 = T.axis.spatial(1, 0)
                 ax1_2 = T.axis.spatial(16, ax0)
                 ax2_2 = T.axis.spatial(225, i2_0 * 80 + ax1 - 3)
                 ax3 = T.axis.spatial(225, i3_0 * 80 + ax2 - 3)
                 T.where(3 <= i2_0 * 80 + ax1 and i2_0 * 80 + ax1 < 228
                         and 3 <= i3_0 * 80 + ax2 and i3_0 * 80 + ax2 < 228
                         and i2_0 * 80 + ax1 < 231
                         and i3_0 * 80 + ax2 < 231)
                 T.reads(x[ax0_2, ax1_2, ax2_2, ax3])
                 T.writes(pad_temp[ax0_2, ax1_2, ax2_2 + 3, ax3 + 3])
                 pad_temp[ax0_2, ax1_2, ax2_2 + 3,
                          ax3 + 3] = x[ax0_2, ax1_2, ax2_2, ax3]
         for i1, i2_1, i3_1, i4, i5 in T.grid(16, 80, 80, 7, 7):
             with T.block("tensor"):
                 ax0_3, ax1_3 = T.axis.remap("SS", [i0, i1])
                 ax2_3 = T.axis.spatial(225, i2_0 * 80 + i2_1)
                 ax3 = T.axis.spatial(225, i3_0 * 80 + i3_1)
                 rv0, rv1 = T.axis.remap("RR", [i4, i5])
                 T.where(i2_0 * 80 + i2_1 < 225 and i3_0 * 80 + i3_1 < 225)
                 T.reads(pad_temp[ax0_3, ax1_3, ax2_3 + rv0, ax3 + rv1])
                 T.writes(tensor[ax0_3, ax1_3, ax2_3, ax3])
                 with T.init():
                     tensor[ax0_3, ax1_3, ax2_3, ax3] = T.int8(0)
                 tensor[ax0_3, ax1_3, ax2_3, ax3] = (
                     tensor[ax0_3, ax1_3, ax2_3, ax3] +
                     pad_temp[ax0_3, ax1_3, ax2_3 + rv0, ax3 + rv1])
예제 #5
0
 def pooling_decompose_0(x: T.Buffer[(1, 16, 225, 225), "int8"],
                         tensor: T.Buffer[(1, 16, 225, 225), "int8"]):
     pad_temp = T.alloc_buffer([1, 16, 231, 231], dtype="int8")
     for i0, i1, i2, i3 in T.grid(1, 16, 231, 231):
         with T.block("pad_temp_pad_const"):
             ax0, ax1, ax2, ax3 = T.axis.remap("SSSS", [i0, i1, i2, i3])
             pad_temp[ax0, ax1, ax2, ax3] = T.int8(0)
     for i0, i1, i2, i3 in T.grid(1, 16, 225, 225):
         with T.block("pad_temp"):
             ax0, ax1, ax2, ax3 = T.axis.remap("SSSS", [i0, i1, i2, i3])
             pad_temp[ax0, ax1, ax2 + 3, ax3 + 3] = x[ax0, ax1, ax2, ax3]
     for i0, i1, i2, i3, i4, i5 in T.grid(1, 16, 225, 225, 7, 7):
         with T.block("tensor"):
             ax0, ax1, ax2, ax3, rv0, rv1 = T.axis.remap(
                 "SSSSRR", [i0, i1, i2, i3, i4, i5])
             with T.init():
                 tensor[ax0, ax1, ax2, ax3] = T.int8(0)
             tensor[ax0, ax1, ax2,
                    ax3] = (tensor[ax0, ax1, ax2, ax3] +
                            pad_temp[ax0, ax1, ax2 + rv0, ax3 + rv1])
예제 #6
0
def sum_pool_2d(x: T.Buffer[(1, 16, 225, 225), "int8"],
                tensor: T.Buffer[(1, 16, 225, 225), "int8"]):
    pad_temp = T.alloc_buffer([1, 16, 231, 231], dtype="int8")
    for i0, i1, i2, i3 in T.grid(1, 16, 231, 231):
        with T.block("pad_temp"):
            ax0, ax1, ax2, ax3 = T.axis.remap("SSSS", [i0, i1, i2, i3])
            pad_temp[ax0, ax1, ax2, ax3] = T.if_then_else(
                3 <= ax2 and ax2 < 228 and 3 <= ax3 and ax3 < 228,
                x[ax0, ax1, ax2 - 3, ax3 - 3],
                T.int8(0),
                dtype="int8",
            )
    for i0, i1, i2, i3, i4, i5 in T.grid(1, 16, 225, 225, 7, 7):
        with T.block("tensor"):
            ax0, ax1, ax2, ax3, rv0, rv1 = T.axis.remap(
                "SSSSRR", [i0, i1, i2, i3, i4, i5])
            with T.init():
                tensor[ax0, ax1, ax2, ax3] = T.int8(0)
            tensor[ax0, ax1, ax2,
                   ax3] = (tensor[ax0, ax1, ax2, ax3] +
                           pad_temp[ax0, ax1, ax2 + rv0, ax3 + rv1])
예제 #7
0
 def main(placeholder: T.Buffer[(301056, ), "int8"],
          ethosu_write: T.Buffer[(75264, ), "int8"]) -> None:
     T.func_attr({
         "from_legacy_te_schedule": True,
         "global_symbol": "main",
         "tir.noalias": True
     })
     T.preflattened_buffer(placeholder, [1, 56, 56, 96],
                           dtype='int8',
                           data=placeholder.data)
     T.preflattened_buffer(ethosu_write, [1, 56, 56, 24],
                           dtype='int8',
                           data=ethosu_write.data)
     buffer1 = T.buffer_decl([2608], "uint8")
     buffer2 = T.buffer_decl([240], "uint8")
     buffer3 = T.buffer_decl([736], "uint8")
     buffer4 = T.buffer_decl([240], "uint8")
     p1 = T.allocate([2608],
                     "uint8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     p2 = T.allocate([240],
                     "uint8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     p3 = T.allocate([736],
                     "uint8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     p4 = T.allocate([240],
                     "uint8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     p5 = T.allocate([75264],
                     "int8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     p6 = T.allocate([75264],
                     "int8",
                     "global",
                     annotations={"disable_lower_builtin": True})
     T.evaluate(
         T.call_extern("ethosu_copy",
                       buffer1[0],
                       2608,
                       p1[0],
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_copy",
                       buffer2[0],
                       240,
                       p2[0],
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_copy",
                       buffer3[0],
                       736,
                       p3[0],
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_copy",
                       buffer4[0],
                       240,
                       p4[0],
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       56,
                       56,
                       96,
                       56,
                       0,
                       56,
                       placeholder[0],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       5376,
                       96,
                       1,
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       p5[0],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       1344,
                       24,
                       1,
                       1,
                       1,
                       1,
                       1,
                       1,
                       1,
                       p1[0],
                       2608,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       p2[0],
                       240,
                       T.int8(-1),
                       T.int8(-1),
                       0,
                       0,
                       0,
                       0,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       p5[0],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       1344,
                       24,
                       1,
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       p6[0],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       1344,
                       24,
                       1,
                       1,
                       1,
                       1,
                       1,
                       1,
                       1,
                       p3[0],
                       736,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       p4[0],
                       240,
                       T.int8(-1),
                       T.int8(-1),
                       0,
                       0,
                       0,
                       0,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_binary_elementwise",
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       p5[0],
                       0,
                       0,
                       0,
                       T.float32(1),
                       0,
                       "NHWC",
                       1344,
                       24,
                       1,
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       p6[0],
                       0,
                       0,
                       0,
                       T.float32(1),
                       0,
                       "NHWC",
                       1344,
                       24,
                       1,
                       "int8",
                       56,
                       56,
                       24,
                       56,
                       0,
                       56,
                       ethosu_write[0],
                       0,
                       0,
                       0,
                       T.float32(1),
                       0,
                       "NHWC",
                       1344,
                       24,
                       1,
                       "ADD",
                       0,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       0,
                       0,
                       0,
                       dtype="handle"))
예제 #8
0
 def main(placeholder: T.Buffer[(1536, ), "int8"],
          placeholder_1: T.Buffer[(1280, ), "int8"],
          T_concat: T.Buffer[(4096, ), "int8"]) -> None:
     # function attr dict
     T.func_attr({
         "from_legacy_te_schedule": True,
         "global_symbol": "main",
         "tir.noalias": True
     })
     buffer = T.buffer_decl([2992], "uint8")
     buffer_1 = T.buffer_decl([160], "uint8")
     buffer_2 = T.buffer_decl([2992], "uint8")
     buffer_3 = T.buffer_decl([160], "uint8")
     buffer_4 = T.buffer_decl([2992], "uint8")
     buffer_5 = T.buffer_decl([160], "uint8")
     buffer_6 = T.buffer_decl([2992], "uint8")
     buffer_7 = T.buffer_decl([160], "uint8")
     # body
     T_concat_1 = T.allocate([2816],
                             "int8",
                             "global",
                             annotations={"disable_lower_builtin": True})
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       8,
                       10,
                       16,
                       8,
                       0,
                       10,
                       placeholder_1[0],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       160,
                       16,
                       1,
                       "int8",
                       8,
                       10,
                       16,
                       8,
                       0,
                       10,
                       T_concat_1[192],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       352,
                       16,
                       1,
                       3,
                       3,
                       1,
                       1,
                       1,
                       1,
                       buffer[0],
                       2992,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       buffer_1[0],
                       160,
                       T.int8(-1),
                       T.int8(-1),
                       1,
                       1,
                       1,
                       1,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       8,
                       10,
                       16,
                       8,
                       0,
                       10,
                       T_concat_1[192],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       352,
                       16,
                       1,
                       "int8",
                       8,
                       10,
                       16,
                       8,
                       0,
                       10,
                       T_concat[352],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       512,
                       16,
                       1,
                       3,
                       3,
                       1,
                       1,
                       1,
                       1,
                       buffer_2[0],
                       2992,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       buffer_3[0],
                       160,
                       T.int8(-1),
                       T.int8(-1),
                       1,
                       1,
                       1,
                       1,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       8,
                       12,
                       16,
                       8,
                       0,
                       12,
                       placeholder[0],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       192,
                       16,
                       1,
                       "int8",
                       8,
                       12,
                       16,
                       8,
                       0,
                       12,
                       T_concat_1[0],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       352,
                       16,
                       1,
                       3,
                       3,
                       1,
                       1,
                       1,
                       1,
                       buffer_4[0],
                       2992,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       buffer_5[0],
                       160,
                       T.int8(-1),
                       T.int8(-1),
                       1,
                       1,
                       1,
                       1,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
     T.evaluate(
         T.call_extern("ethosu_conv2d",
                       "int8",
                       8,
                       22,
                       16,
                       8,
                       0,
                       22,
                       T_concat_1[0],
                       0,
                       0,
                       0,
                       T.float32(0.5),
                       10,
                       "NHWC",
                       352,
                       16,
                       1,
                       "int8",
                       8,
                       22,
                       16,
                       8,
                       0,
                       22,
                       T_concat[0],
                       0,
                       0,
                       0,
                       T.float32(0.25),
                       14,
                       "NHWC",
                       512,
                       16,
                       1,
                       3,
                       3,
                       1,
                       1,
                       1,
                       1,
                       buffer_6[0],
                       2992,
                       T.int8(-1),
                       T.int8(-1),
                       12,
                       buffer_7[0],
                       160,
                       T.int8(-1),
                       T.int8(-1),
                       1,
                       1,
                       1,
                       1,
                       "NONE",
                       0,
                       0,
                       "TFL",
                       "NONE",
                       0,
                       0,
                       0,
                       dtype="handle"))
예제 #9
0
 def main(placeholder_5: T.Buffer[(8192,), "int8"], ethosu_write_1: T.Buffer[(4096,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([416], "uint8")
     buffer_1 = T.buffer_decl([112], "uint8")
     buffer_2 = T.buffer_decl([272], "uint8")
     buffer_3 = T.buffer_decl([64], "uint8")
     T.preflattened_buffer(placeholder_5, [1, 16, 16, 32], dtype="int8", data=placeholder_5.data)
     T.preflattened_buffer(ethosu_write_1, [1, 16, 16, 16], dtype="int8", data=ethosu_write_1.data)
     # body
     placeholder_global_unrolled_iter_0 = T.allocate([416], "uint8", "global", annotations={"disable_lower_builtin": True})
     placeholder_d_global_unrolled_iter_0 = T.allocate([112], "uint8", "global", annotations={"disable_lower_builtin": True})
     placeholder_global_unrolled_iter_1 = T.allocate([272], "uint8", "global", annotations={"disable_lower_builtin": True})
     placeholder_d_global_unrolled_iter_1 = T.allocate([64],  "uint8", "global", annotations={"disable_lower_builtin": True})
     T.evaluate(T.call_extern("ethosu_copy", buffer[0], 416, placeholder_global_unrolled_iter_0[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_copy", buffer_1[0], 112, placeholder_d_global_unrolled_iter_0[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_copy", buffer_2[0], 272, placeholder_global_unrolled_iter_1[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_copy", buffer_3[0], 64, placeholder_d_global_unrolled_iter_1[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder_5[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 10, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, placeholder_global_unrolled_iter_0[0], 416, T.int8(-1), T.int8(-1), 12, placeholder_d_global_unrolled_iter_0[0], 112, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder_5[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 6, 16, 0, 16, ethosu_write_1[10], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 16, 1, 1, 1, 1, 1, 1, 1, placeholder_global_unrolled_iter_1[0], 272, T.int8(-1), T.int8(-1), 12, placeholder_d_global_unrolled_iter_1[0], 64, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
예제 #10
0
 def main(placeholder_3: T.Buffer[(8192,), "int8"], ethosu_write_1: T.Buffer[(2048,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([80], "uint8")
     buffer_1 = T.buffer_decl([304], "uint8")
     T.preflattened_buffer(placeholder_3, [1, 16, 16, 32], dtype="int8", data=placeholder_3.data)
     T.preflattened_buffer(ethosu_write_1, [1, 16, 16, 8], dtype="int8", data=ethosu_write_1.data)
     # body
     placeholder_global = T.allocate([304], "uint8", "global", annotations={"disable_lower_builtin": True})
     placeholder_d_global = T.allocate([80], "uint8", "global", annotations={"disable_lower_builtin": True})
     T.evaluate(T.call_extern("ethosu_copy", buffer_1[0], 304, placeholder_global[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_copy", buffer[0], 80, placeholder_d_global[0], dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 32, 16, 0, 16, placeholder_3[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 16, 8, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 128, 8, 1, 1, 1, 1, 1, 1, 1, placeholder_global[0], 304, T.int8(-1), T.int8(-1), 12, placeholder_d_global[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
예제 #11
0
 def main(placeholder_3: T.Buffer[(192,), "int8"], ethosu_write_1: T.Buffer[(768,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([160], "uint8")
     buffer_1 = T.buffer_decl([848], "uint8")
     T.preflattened_buffer(placeholder_3, [192], 'int8', data=placeholder_3.data)
     T.preflattened_buffer(ethosu_write_1, [1, 8, 6, 16], 'int8', data=ethosu_write_1.data)
     # body
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 5, 6, 4, 5, 0, 6, placeholder_3[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 24, 4, 1, "int8", 4, 6, 16, 4, 0, 6, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 96, 16, 1, 3, 3, 1, 1, 1, 1, buffer_1[0], 848, T.int8(-1), T.int8(-1), 12, buffer[0], 160, T.int8(-1), T.int8(-1), 1, 1, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 5, 6, 4, 5, 0, 6, placeholder_3[72], 0, 0, 0, T.float32(0.5), 10, "NHWC", 24, 4, 1, "int8", 4, 6, 16, 4, 0, 6, ethosu_write_1[384], 0, 0, 0, T.float32(0.25), 14, "NHWC", 96, 16, 1, 3, 3, 1, 1, 1, 1, buffer_1[0], 848, T.int8(-1), T.int8(-1), 12, buffer[0], 160, T.int8(-1), T.int8(-1), 0, 1, 1, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
예제 #12
0
 def main(placeholder_3: T.Buffer[(315,), "int8"], ethosu_write_1: T.Buffer[(240,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([160], "uint8")
     buffer_1 = T.buffer_decl([656], "uint8")
     T.preflattened_buffer(placeholder_3, [1, 7, 9, 5], 'int8', data=placeholder_3.data)
     T.preflattened_buffer(ethosu_write_1, [1, 3, 5, 16], 'int8', data=ethosu_write_1.data)
     # body
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 3, 5, 3, 3, 0, 5, placeholder_3[146], 0, 0, 0, T.float32(0.5), 10, "NHWC", 45, 5, 1, "int8", 3, 5, 16, 3, 0, 5, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 80, 16, 1, 3, 3, 1, 1, 1, 1, buffer_1[0], 656, T.int8(-1), T.int8(-1), 12, buffer[0], 160, T.int8(-1), T.int8(-1), 1, 1, 1, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
예제 #13
0
 def main(placeholder: T.Buffer[(1024,), "int8"], ethosu_write: T.Buffer[(32768,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([1456], "uint8")
     buffer_1 = T.buffer_decl([352], "uint8")
     buffer_2 = T.buffer_decl([11040], "uint8")
     buffer_3 = T.buffer_decl([272], "uint8")
     T.preflattened_buffer(placeholder, [1, 8, 1, 8, 16], 'int8', data=placeholder.data)
     T.preflattened_buffer(ethosu_write, [1, 32, 2, 32, 16], 'int8', data=ethosu_write.data)
     # body
     ethosu_write_1 = T.allocate([12288], "int8", "global", annotations={"disable_lower_builtin":True})
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 8, 8, 3, 8, 0, 8, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 128, 16, 1, "int8", 16, 16, 35, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 768, 16, 256, 3, 3, 1, 1, 1, 1, buffer[0], 1456, T.int8(-1), T.int8(-1), 12, buffer_1[0], 352, T.int8(-1), T.int8(-1), 1, 1, 1, 1, "NONE", 0, 0, "TFL", "NEAREST", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 16, 16, 35, 16, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 768, 16, 256, "int8", 32, 32, 26, 32, 0, 32, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 1024, 16, 512, 3, 3, 1, 1, 1, 1, buffer_2[0], 11040, T.int8(-1), T.int8(-1), 12, buffer_3[0], 272, T.int8(-1), T.int8(-1), 1, 1, 1, 1, "NONE", 0, 0, "TFL", "NEAREST", 0, 0, 0, dtype="handle"))
예제 #14
0
 def main(placeholder: T.Buffer[(192,), "int8"], ethosu_write: T.Buffer[(8192,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([160], "uint8")
     buffer_1 = T.buffer_decl([320], "uint8")
     buffer_2 = T.buffer_decl([304], "uint8")
     buffer_3 = T.buffer_decl([80], "uint8")
     T.preflattened_buffer(placeholder, [1, 8, 8, 3], 'int8', data=placeholder.data)
     T.preflattened_buffer(ethosu_write, [1, 32, 32, 8], 'int8', data=ethosu_write.data)
     # body
     ethosu_write_1 = T.allocate([4096], "int8", "global", annotations={"disable_lower_builtin":True})
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 4, 8, 3, 4, 0, 8, placeholder[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 24, 3, 1, "int8", 8, 16, 32, 8, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 512, 32, 1, 1, 1, 1, 1, 1, 1, buffer[0], 160, T.int8(-1), T.int8(-1), 12, buffer_1[0], 320, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "ZEROS", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 8, 16, 32, 8, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 32, 8, 16, 0, 32, ethosu_write[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 8, 1, 1, 1, 1, 1, 1, 1, buffer_2[0], 304, T.int8(-1), T.int8(-1), 12, buffer_3[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "ZEROS", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 4, 8, 3, 4, 0, 8, placeholder[96], 0, 0, 0, T.float32(0.5), 10, "NHWC", 24, 3, 1, "int8", 8, 16, 32, 8, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 512, 32, 1, 1, 1, 1, 1, 1, 1, buffer[0], 160, T.int8(-1), T.int8(-1), 12, buffer_1[0], 320, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "ZEROS", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 8, 16, 32, 8, 0, 16, ethosu_write_1[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 512, 32, 1, "int8", 16, 32, 8, 16, 0, 32, ethosu_write[4096], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 8, 1, 1, 1, 1, 1, 1, 1, buffer_2[0], 304, T.int8(-1), T.int8(-1), 12, buffer_3[0], 80, T.int8(-1), T.int8(-1), 0, 0, 0, 0, "NONE", 0, 0, "TFL", "ZEROS", 0, 0, 0, dtype="handle"))
예제 #15
0
 def main(placeholder_5: T.Buffer[(1024,), "int8"], ethosu_write_1: T.Buffer[(2048,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([1456], "uint8")
     buffer_1 = T.buffer_decl([352], "uint8")
     buffer_2 = T.buffer_decl([272], "uint8")
     buffer_3 = T.buffer_decl([11040], "uint8")
     T.preflattened_buffer(placeholder_5, [1, 8, 1, 8, 16], 'int8', data=placeholder_5.data)
     T.preflattened_buffer(ethosu_write_1, [1, 8, 2, 8, 16], 'int8', data=ethosu_write_1.data)
     # body
     ethosu_write_2 = T.allocate([2304], "int8", "global", annotations={"disable_lower_builtin": True})
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 6, 8, 3, 6, 0, 8, placeholder_5[0], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 128, 16, 1, "int8", 5, 8, 35, 5, 0, 8, ethosu_write_2[384], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 384, 16, 128, 3, 3, 1, 1, 1, 1, buffer[0], 1456, T.int8(-1), T.int8(-1), 12, buffer_1[0], 352, T.int8(-1), T.int8(-1), 1, 1, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 5, 8, 35, 5, 0, 8, ethosu_write_2[384], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 384, 16, 128, "int8", 4, 8, 26, 4, 0, 8, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 256, 16, 128, 3, 3, 1, 1, 1, 1, buffer_3[0], 11040, T.int8(-1), T.int8(-1), 12, buffer_2[0], 272, T.int8(-1), T.int8(-1), 1, 1, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 6, 8, 3, 6, 0, 8, placeholder_5[256], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 128, 16, 1, "int8", 5, 8, 35, 5, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 384, 16, 128, 3, 3, 1, 1, 1, 1, buffer[0], 1456, T.int8(-1), T.int8(-1), 12, buffer_1[0], 352, T.int8(-1), T.int8(-1), 0, 1, 1, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 5, 8, 35, 5, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHCWB16", 384, 16, 128, "int8", 4, 8, 26, 4, 0, 8, ethosu_write_1[1024], 0, 0, 0, T.float32(0.25), 14, "NHCWB16", 256, 16, 128, 3, 3, 1, 1, 1, 1, buffer_3[0], 11040, T.int8(-1), T.int8(-1), 12, buffer_2[0], 272, T.int8(-1), T.int8(-1), 0, 1, 1, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
예제 #16
0
 def main(placeholder_5: T.Buffer[(768,), "int8"], ethosu_write_1: T.Buffer[(640,), "int8"]) -> None:
     # function attr dict
     T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
     buffer = T.buffer_decl([1744], "uint8")
     buffer_1 = T.buffer_decl([80], "uint8")
     buffer_2 = T.buffer_decl([320], "uint8")
     buffer_3 = T.buffer_decl([880], "uint8")
     T.preflattened_buffer(placeholder_5, [1, 16, 16, 3], 'int8', data=placeholder_5.data)
     T.preflattened_buffer(ethosu_write_1, [1, 20, 4, 8], 'int8', data=ethosu_write_1.data)
     # body
     ethosu_write_2 = T.allocate([2560], "int8", "global", annotations={"disable_lower_builtin": True})
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 8, 16, 3, 8, 0, 16, placeholder_5[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 48, 3, 1, "int8", 8, 8, 32, 8, 0, 8, ethosu_write_2[512], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 32, 1, 2, 3, 2, 1, 2, 1, buffer_3[0], 880, T.int8(-1), T.int8(-1), 12, buffer_2[0], 320, T.int8(-1), T.int8(-1), 2, 1, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 8, 8, 32, 8, 0, 8, ethosu_write_2[512], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 32, 1, "int8", 8, 4, 8, 8, 0, 4, ethosu_write_1[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 32, 8, 1, 2, 3, 2, 1, 2, 1, buffer[0], 1744, T.int8(-1), T.int8(-1), 12, buffer_1[0], 80, T.int8(-1), T.int8(-1), 2, 1, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 12, 16, 3, 12, 0, 16, placeholder_5[192], 0, 0, 0, T.float32(0.5), 10, "NHWC", 48, 3, 1, "int8", 10, 8, 32, 10, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 32, 1, 2, 3, 2, 1, 2, 1, buffer_3[0], 880, T.int8(-1), T.int8(-1), 12, buffer_2[0], 320, T.int8(-1), T.int8(-1), 0, 1, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 10, 8, 32, 10, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 32, 1, "int8", 8, 4, 8, 8, 0, 4, ethosu_write_1[256], 0, 0, 0, T.float32(0.25), 14, "NHWC", 32, 8, 1, 2, 3, 2, 1, 2, 1, buffer[0], 1744, T.int8(-1), T.int8(-1), 12, buffer_1[0], 80, T.int8(-1), T.int8(-1), 0, 1, 0, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 4, 16, 3, 4, 0, 16, placeholder_5[576], 0, 0, 0, T.float32(0.5), 10, "NHWC", 48, 3, 1, "int8", 4, 8, 32, 4, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.25), 14, "NHWC", 256, 32, 1, 2, 3, 2, 1, 2, 1, buffer_3[0], 880, T.int8(-1), T.int8(-1), 12, buffer_2[0], 320, T.int8(-1), T.int8(-1), 0, 1, 2, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
     T.evaluate(T.call_extern("ethosu_conv2d", "int8", 4, 8, 32, 4, 0, 8, ethosu_write_2[0], 0, 0, 0, T.float32(0.5), 10, "NHWC", 256, 32, 1, "int8", 4, 4, 8, 4, 0, 4, ethosu_write_1[512], 0, 0, 0, T.float32(0.25), 14, "NHWC", 32, 8, 1, 2, 3, 2, 1, 2, 1, buffer[0], 1744, T.int8(-1), T.int8(-1), 12, buffer_1[0], 80, T.int8(-1), T.int8(-1), 0, 1, 2, 0, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))