@@ -54,7 +54,7 @@ func.func @test_avg_pool2d_q8(%arg0: tensor<1x7x7x9x!quant.uniform<i8:f32, 0.01>
54
54
// -----
55
55
// CHECK-LABEL: conv2d
56
56
func.func @test_conv2d (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <8 x1 x1 x4 xf32 >, %arg2: tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
57
- %0 = tosa.conv2d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >} : (tensor <1 x4 x4 x4 xf32 >, tensor <8 x1 x1 x4 xf32 >, tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
57
+ %0 = tosa.conv2d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, local_bound = true } : (tensor <1 x4 x4 x4 xf32 >, tensor <8 x1 x1 x4 xf32 >, tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
58
58
return %0 : tensor <1 x4 x4 x8 xf32 >
59
59
}
60
60
@@ -68,20 +68,48 @@ func.func @test_conv2d_q8xi4(%arg0: tensor<1x11x11x3xi8>) -> tensor<1x1x1x3xi8>
68
68
return %3 : tensor <1 x1 x1 x3 xi8 >
69
69
}
70
70
71
+ // -----
72
+ // CHECK-LABEL: conv3d
73
+ func.func @test_conv3d (%arg0: tensor <1 x4 x8 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <34 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
74
+ %0 = tosa.conv3d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 1 >} : (tensor <1 x4 x8 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <34 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
75
+ return %0 : tensor <1 x4 x8 x21 x34 xf32 >
76
+ }
77
+
78
+ // -----
79
+ // CHECK-LABEL: conv3d_with_local_bound
80
+ func.func @test_conv3d_with_local_bound (%arg0: tensor <1 x4 x8 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <34 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
81
+ %0 = tosa.conv3d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 1 >, local_bound = true } : (tensor <1 x4 x8 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <34 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
82
+ return %0 : tensor <1 x4 x8 x21 x34 xf32 >
83
+ }
84
+
71
85
// -----
72
86
// CHECK-LABEL: depthwise_conv2d
73
87
func.func @test_depthwise_conv2d (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x4 x2 xf32 >, %arg2: tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
74
88
%0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >} : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x4 x2 xf32 >, tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
75
89
return %0 : tensor <1 x4 x4 x8 xf32 >
76
90
}
77
91
92
+ // -----
93
+ // CHECK-LABEL: depthwise_conv2d_with_local_bound
94
+ func.func @test_depthwise_conv2d_with_local_bound (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x4 x2 xf32 >, %arg2: tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
95
+ %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, local_bound = true } : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x4 x2 xf32 >, tensor <8 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
96
+ return %0 : tensor <1 x4 x4 x8 xf32 >
97
+ }
98
+
78
99
// -----
79
100
// CHECK-LABEL: fft2d
80
101
func.func @test_fft2d (%arg0: tensor <1 x4 x8 xf32 >, %arg1: tensor <1 x4 x8 xf32 >) -> (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >) {
81
102
%0 , %1 = tosa.fft2d %arg0 , %arg1 {inverse = false } : (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >) -> (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >)
82
103
return %0 , %1 : tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >
83
104
}
84
105
106
+ // -----
107
+ // CHECK-LABEL: fft2d_with_local_bound
108
+ func.func @test_fft2d_with_local_bound (%arg0: tensor <1 x4 x8 xf32 >, %arg1: tensor <1 x4 x8 xf32 >) -> (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >) {
109
+ %0 , %1 = tosa.fft2d %arg0 , %arg1 {inverse = false , local_bound = true } : (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >) -> (tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >)
110
+ return %0 , %1 : tensor <1 x4 x8 xf32 >, tensor <1 x4 x8 xf32 >
111
+ }
112
+
85
113
// -----
86
114
// CHECK-LABEL: fully_connected
87
115
func.func @test_fully_connected (%arg0: tensor <14 x19 xf32 >, %arg1: tensor <19 x28 xf32 >, %arg2: tensor <28 xf32 >) -> tensor <14 x28 xf32 > {
@@ -124,13 +152,27 @@ func.func @test_rfft2d(%arg0: tensor<13x8x16xf32>) -> (tensor<13x8x9xf32>, tenso
124
152
return %0 , %1 : tensor <13 x8 x9 xf32 >, tensor <13 x8 x9 xf32 >
125
153
}
126
154
155
+ // -----
156
+ // CHECK-LABEL: rfft2d_with_local_bound
157
+ func.func @test_rfft2d_with_local_bound (%arg0: tensor <13 x8 x16 xf32 >) -> (tensor <13 x8 x9 xf32 >, tensor <13 x8 x9 xf32 >) {
158
+ %0 , %1 = tosa.rfft2d %arg0 {local_bound = true } : (tensor <13 x8 x16 xf32 >) -> (tensor <13 x8 x9 xf32 >, tensor <13 x8 x9 xf32 >)
159
+ return %0 , %1 : tensor <13 x8 x9 xf32 >, tensor <13 x8 x9 xf32 >
160
+ }
161
+
127
162
// -----
128
163
// CHECK-LABEL: transpose_conv2d
129
164
func.func @test_transpose_conv2d (%arg0: tensor <1 x32 x32 x8 xf32 >, %arg1: tensor <16 x1 x1 x8 xf32 >, %arg2: tensor <16 xf32 >) -> tensor <1 x32 x32 x16 xf32 > {
130
165
%0 = tosa.transpose_conv2d %arg0 , %arg1 , %arg2 {out_pad = array<i64 : 0 , 0 , 0 , 0 >, out_shape = array<i64 : 1 , 32 , 32 , 16 >, stride = array<i64 : 1 , 1 >} : (tensor <1 x32 x32 x8 xf32 >, tensor <16 x1 x1 x8 xf32 >, tensor <16 xf32 >) -> tensor <1 x32 x32 x16 xf32 >
131
166
return %0 : tensor <1 x32 x32 x16 xf32 >
132
167
}
133
168
169
+ // -----
170
+ // CHECK-LABEL: transpose_conv2d_with_local_bound
171
+ func.func @test_transpose_conv2d_with_local_bound (%arg0: tensor <1 x32 x32 x8 xf32 >, %arg1: tensor <16 x1 x1 x8 xf32 >, %arg2: tensor <16 xf32 >) -> tensor <1 x32 x32 x16 xf32 > {
172
+ %0 = tosa.transpose_conv2d %arg0 , %arg1 , %arg2 {out_pad = array<i64 : 0 , 0 , 0 , 0 >, out_shape = array<i64 : 1 , 32 , 32 , 16 >, stride = array<i64 : 1 , 1 >, local_bound = false } : (tensor <1 x32 x32 x8 xf32 >, tensor <16 x1 x1 x8 xf32 >, tensor <16 xf32 >) -> tensor <1 x32 x32 x16 xf32 >
173
+ return %0 : tensor <1 x32 x32 x16 xf32 >
174
+ }
175
+
134
176
// -----
135
177
// CHECK-LABEL: clamp
136
178
func.func @test_clamp (%arg0: tensor <13 x21 x3 xf32 >) -> tensor <13 x21 x3 xf32 > {
0 commit comments