@@ -197,42 +197,6 @@ func.func @test_depthwise_conv2d_invalid_dilation(%arg0: tensor<1x4x4x4xf32>, %a
197197
198198// -----
199199
200- func.func @test_depthwise_conv2d_wholly_divisible_height (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x8 x4 xf32 >, %arg2: tensor <8 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
201- // expected-error@+1 {{'tosa.depthwise_conv2d' op expected input_height - 1 + pad_top + pad_bottom - (kernel_height - 1) * dilation_y to be wholly divisible by stride_y, got (4 - 1 + 0 + 0 - (1 - 1) * 1) / 2}}
202- %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 2 , 1 >, local_bound = true }
203- : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x8 x4 xf32 >, tensor <8 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
204- return %0 : tensor <1 x4 x4 x8 xf32 >
205- }
206-
207- // -----
208-
209- func.func @test_depthwise_conv2d_wholly_divisible_width (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x8 x4 xf32 >, %arg2: tensor <8 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
210- // expected-error@+1 {{'tosa.depthwise_conv2d' op expected input_width - 1 + pad_left + pad_right - (kernel_width - 1) * dilation_x to be wholly divisible by stride_x, got (4 - 1 + 0 + 0 - (1 - 1) * 1) / 2}}
211- %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 2 >, local_bound = true }
212- : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x8 x4 xf32 >, tensor <8 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x4 x8 xf32 >
213- return %0 : tensor <1 x4 x4 x8 xf32 >
214- }
215-
216- // -----
217-
218- func.func @test_depthwise_conv2d_unexpected_output_height (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x8 x4 xf32 >, %arg2: tensor <8 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x6 x4 x8 xf32 > {
219- // expected-error@+1 {{'tosa.depthwise_conv2d' op calculated output height did not match expected: calculated=4, expected=6}}
220- %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, local_bound = true }
221- : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x8 x4 xf32 >, tensor <8 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x6 x4 x8 xf32 >
222- return %0 : tensor <1 x6 x4 x8 xf32 >
223- }
224-
225- // -----
226-
227- func.func @test_depthwise_conv2d_unexpected_output_width (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x8 x4 xf32 >, %arg2: tensor <8 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x6 x8 xf32 > {
228- // expected-error@+1 {{'tosa.depthwise_conv2d' op calculated output width did not match expected: calculated=4, expected=6}}
229- %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, local_bound = true }
230- : (tensor <1 x4 x4 x4 xf32 >, tensor <1 x1 x8 x4 xf32 >, tensor <8 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x6 x8 xf32 >
231- return %0 : tensor <1 x4 x6 x8 xf32 >
232- }
233-
234- // -----
235-
236200func.func @test_depthwise_conv2d_invalid_bias_size (%arg0: tensor <1 x4 x4 x4 xf32 >, %arg1: tensor <1 x1 x8 x4 xf32 >, %arg2: tensor <7 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x4 x8 xf32 > {
237201 // expected-error@+1 {{'tosa.depthwise_conv2d' op bias channels expected to be equal to output channels (8) or 1, got 7}}
238202 %0 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, local_bound = true }
@@ -268,60 +232,6 @@ func.func @test_conv3d_invalid_dilation(%arg0: tensor<1x4x8x21x17xf32>, %arg1: t
268232
269233// -----
270234
271- func.func @test_conv3d_wholly_divisible_input_depth (%arg0: tensor <1 x4 x16 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
272- // expected-error@+1 {{'tosa.conv3d' op expected input_depth - 1 + pad_front + pad_back - (kernel_depth - 1) * dilation_d to be wholly divisible by stride_d, got (4 - 1 + 0 + 0 - (1 - 1) * 1) / 2}}
273- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 2 , 1 , 1 >}
274- : (tensor <1 x4 x16 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
275- return %0 : tensor <1 x4 x8 x21 x34 xf32 >
276- }
277-
278- // -----
279-
280- func.func @test_conv3d_wholly_divisible_input_height (%arg0: tensor <1 x4 x10 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
281- // expected-error@+1 {{'tosa.conv3d' op expected input_height - 1 + pad_top + pad_bottom - (kernel_height - 1) * dilation_y to be wholly divisible by stride_y, got (10 - 1 + 0 + 0 - (1 - 1) * 1) / 4}}
282- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 4 , 1 >}
283- : (tensor <1 x4 x10 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
284- return %0 : tensor <1 x4 x8 x21 x34 xf32 >
285- }
286-
287- // -----
288-
289- func.func @test_conv3d_wholly_divisible_input_width (%arg0: tensor <1 x4 x8 x21 x19 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
290- // expected-error@+1 {{'tosa.conv3d' op expected input_width - 1 + pad_left + pad_right - (kernel_width - 1) * dilation_x to be wholly divisible by stride_x, got (21 - 1 + 0 + 0 - (1 - 1) * 1) / 8}}
291- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 8 >}
292- : (tensor <1 x4 x8 x21 x19 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
293- return %0 : tensor <1 x4 x8 x21 x34 xf32 >
294- }
295-
296- // -----
297-
298- func.func @test_conv3d_wholly_divisible_output_depth (%arg0: tensor <1 x4 x10 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x3 x10 x21 x34 xf32 > {
299- // expected-error@+1 {{'tosa.conv3d' op calculated output depth did not match expected: calculated=4, expected=3}}
300- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 1 >}
301- : (tensor <1 x4 x10 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x3 x10 x21 x34 xf32 >
302- return %0 : tensor <1 x3 x10 x21 x34 xf32 >
303- }
304-
305- // -----
306-
307- func.func @test_conv3d_wholly_divisible_output_height (%arg0: tensor <1 x4 x16 x21 x17 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 > {
308- // expected-error@+1 {{'tosa.conv3d' op calculated output height did not match expected: calculated=16, expected=8}}
309- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 1 >}
310- : (tensor <1 x4 x16 x21 x17 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x8 x21 x34 xf32 >
311- return %0 : tensor <1 x4 x8 x21 x34 xf32 >
312- }
313-
314- // -----
315-
316- func.func @test_conv3d_wholly_divisible_output_width (%arg0: tensor <1 x4 x8 x21 x19 xf32 >, %arg1: tensor <34 x1 x1 x1 x17 xf32 >, %arg2: tensor <21 xf32 >, %arg3: tensor <1 xf32 >, %arg4: tensor <1 xf32 >) -> tensor <1 x4 x8 x19 x34 xf32 > {
317- // expected-error@+1 {{'tosa.conv3d' op calculated output width did not match expected: calculated=21, expected=19}}
318- %0 = tosa.conv3d %arg0 , %arg1 , %arg2 , %arg3 , %arg4 {acc_type = f32 , dilation = array<i64 : 1 , 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 , 1 >}
319- : (tensor <1 x4 x8 x21 x19 xf32 >, tensor <34 x1 x1 x1 x17 xf32 >, tensor <21 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x4 x8 x19 x34 xf32 >
320- return %0 : tensor <1 x4 x8 x19 x34 xf32 >
321- }
322-
323- // -----
324-
325235func.func @test_concat_element_type_mismatch (%arg0 : tensor <1 x2 xf32 >, %arg1 : tensor <2 x2 xf32 >) -> tensor <?x?xi8 > {
326236 // expected-error@+1 {{'tosa.concat' op expect input and output to have same element type, got 'f32' and 'i8'}}
327237 %0 = tosa.concat %arg0 , %arg1 {axis = 0 : i32 } : (tensor <1 x2 xf32 >, tensor <2 x2 xf32 >) -> tensor <?x?xi8 >
0 commit comments