@@ -218,10 +218,10 @@ func.func @test_pad_non_const(%arg0: tensor<13x21x3xf32>, %arg1: !tosa.shape<6>)
218
218
219
219
// -----
220
220
221
- func.func @test_pad_non_const (%arg0: tensor <13 x21 x3 xi8 >, %arg1: tensor <i8 >) -> tensor <13 x21 x3 xi8 > {
221
+ func.func @test_pad_non_const (%arg0: tensor <13 x21 x3 xi8 >, %arg1: tensor <1 x i8 >) -> tensor <13 x21 x3 xi8 > {
222
222
%0 = tosa.const_shape {value = dense <[0 , 0 , 0 , 1 , 0 , 1 ]> : tensor <6 xindex >} : () -> !tosa.shape <6 >
223
223
// expected-error@+1 {{'tosa.pad' op pad_const of pad is not constant}}
224
- %1 = tosa.pad %arg0 , %0 , %arg1 : (tensor <13 x21 x3 xi8 >, !tosa.shape <6 >, tensor <i8 >) -> tensor <13 x21 x3 xi8 >
224
+ %1 = tosa.pad %arg0 , %0 , %arg1 : (tensor <13 x21 x3 xi8 >, !tosa.shape <6 >, tensor <1 x i8 >) -> tensor <13 x21 x3 xi8 >
225
225
return %1 : tensor <13 x21 x3 xi8 >
226
226
}
227
227
@@ -248,7 +248,7 @@ func.func @test_pad_invalid_padding_rank(%arg0: tensor<13x21xf32>) {
248
248
func.func @test_pad_invalid_padConst_rank (%arg0: tensor <13 x21 xf32 >, %arg1: tensor <2 x2 xi32 >) {
249
249
%0 = tosa.const_shape {value = dense <1 > : tensor <4 xindex >} : () -> !tosa.shape <4 >
250
250
%1 = " tosa.const" () {value = dense <3.14 > : tensor <2 xf32 >} : () -> tensor <2 xf32 >
251
- // expected-error@+1 {{'tosa.pad' op operand #2 must be 0D tensor of number values, but got 'tensor<2xf32>'}}
251
+ // expected-error@+1 {{'tosa.pad' op operand #2 must be tosa-conformant scalar tensor of number values, but got 'tensor<2xf32>'}}
252
252
%2 = tosa.pad %arg0 , %0 , %1 : (tensor <13 x21 xf32 >, !tosa.shape <4 >, tensor <2 xf32 >) -> tensor <13 x21 xf32 >
253
253
return
254
254
}
@@ -545,22 +545,22 @@ func.func @test_const_attribute_type_mismatch() -> tensor<100x100xf32> {
545
545
// -----
546
546
547
547
func.func @test_conv2d_static_zero_dim_input (%arg0: tensor <1 x29 x0 x4 xf32 >, %arg1: tensor <16 x3 x3 x4 xf32 >, %arg2: tensor <16 xf32 >) -> tensor <1 x27 x27 x16 xf32 > {
548
- %input_zp = " tosa.const" () <{value = dense <0 > : tensor <i32 >}> : () -> tensor <i32 >
549
- %weight_zp = " tosa.const" () <{value = dense <0 > : tensor <i32 >}> : () -> tensor <i32 >
548
+ %input_zp = " tosa.const" () <{value = dense <0 > : tensor <1 x i32 >}> : () -> tensor <1 x i32 >
549
+ %weight_zp = " tosa.const" () <{value = dense <0 > : tensor <1 x i32 >}> : () -> tensor <1 x i32 >
550
550
// expected-error@+1 {{'tosa.conv2d' op operand #0 must be 4-d tosa-conformant tensor, but got 'tensor<1x29x0x4xf32>'}}
551
551
%0 = tosa.conv2d %arg0 , %arg1 , %arg2 , %input_zp , %weight_zp {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >}
552
- : (tensor <1 x29 x0 x4 xf32 >, tensor <16 x3 x3 x4 xf32 >, tensor <16 xf32 >, tensor <i32 >, tensor <i32 >) -> tensor <1 x27 x27 x16 xf32 >
552
+ : (tensor <1 x29 x0 x4 xf32 >, tensor <16 x3 x3 x4 xf32 >, tensor <16 xf32 >, tensor <1 x i32 >, tensor <1 x i32 >) -> tensor <1 x27 x27 x16 xf32 >
553
553
return %0 : tensor <1 x27 x27 x16 xf32 >
554
554
}
555
555
556
556
// -----
557
557
558
558
func.func @test_conv2d_zero_dim_input (%arg0: tensor <1 x?x0 x4 xf32 >, %arg1: tensor <16 x3 x3 x4 xf32 >, %arg2: tensor <16 xf32 >) -> tensor <1 x27 x27 x16 xf32 > {
559
- %input_zp = " tosa.const" () <{value = dense <0 > : tensor <i32 >}> : () -> tensor <i32 >
560
- %weight_zp = " tosa.const" () <{value = dense <0 > : tensor <i32 >}> : () -> tensor <i32 >
559
+ %input_zp = " tosa.const" () <{value = dense <0 > : tensor <1 x i32 >}> : () -> tensor <1 x i32 >
560
+ %weight_zp = " tosa.const" () <{value = dense <0 > : tensor <1 x i32 >}> : () -> tensor <1 x i32 >
561
561
// expected-error@+1 {{'tosa.conv2d' op operand #0 must be 4-d tosa-conformant tensor, but got 'tensor<1x?x0x4xf32>'}}
562
562
%0 = tosa.conv2d %arg0 , %arg1 , %arg2 , %input_zp , %weight_zp {acc_type = f32 , dilation = array<i64 : 1 , 1 >, pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >}
563
- : (tensor <1 x?x0 x4 xf32 >, tensor <16 x3 x3 x4 xf32 >, tensor <16 xf32 >, tensor <i32 >, tensor <i32 >) -> tensor <1 x27 x27 x16 xf32 >
563
+ : (tensor <1 x?x0 x4 xf32 >, tensor <16 x3 x3 x4 xf32 >, tensor <16 xf32 >, tensor <1 x i32 >, tensor <1 x i32 >) -> tensor <1 x27 x27 x16 xf32 >
564
564
return %0 : tensor <1 x27 x27 x16 xf32 >
565
565
}
566
566
@@ -1046,6 +1046,7 @@ func.func @test_shape_type(%arg0: !tosa.shape<-1>) -> !tosa.shape<-1> {
1046
1046
}
1047
1047
1048
1048
// -----
1049
+
1049
1050
func.func @test_const_shape () -> !tosa.shape <4 > {
1050
1051
// expected-error@+1 {{'tosa.const_shape' op attribute 'value' failed to satisfy constraint: index elements attribute}}
1051
1052
%cst = tosa.const_shape {value = dense <[1 , 2 , 3 , 4 ]> : tensor <4 xi32 >} : () -> !tosa.shape <4 >
0 commit comments