@@ -218,10 +218,10 @@ func.func @test_pad_non_const(%arg0: tensor<13x21x3xf32>, %arg1: !tosa.shape<6>)
218218
219219// -----
220220
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 > {
222222 %0 = tosa.const_shape {value = dense <[0 , 0 , 0 , 1 , 0 , 1 ]> : tensor <6 xindex >} : () -> !tosa.shape <6 >
223223 // 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 >
225225 return %1 : tensor <13 x21 x3 xi8 >
226226}
227227
@@ -248,7 +248,7 @@ func.func @test_pad_invalid_padding_rank(%arg0: tensor<13x21xf32>) {
248248func.func @test_pad_invalid_padConst_rank (%arg0: tensor <13 x21 xf32 >, %arg1: tensor <2 x2 xi32 >) {
249249 %0 = tosa.const_shape {value = dense <1 > : tensor <4 xindex >} : () -> !tosa.shape <4 >
250250 %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>'}}
252252 %2 = tosa.pad %arg0 , %0 , %1 : (tensor <13 x21 xf32 >, !tosa.shape <4 >, tensor <2 xf32 >) -> tensor <13 x21 xf32 >
253253 return
254254}
@@ -545,22 +545,22 @@ func.func @test_const_attribute_type_mismatch() -> tensor<100x100xf32> {
545545// -----
546546
547547func.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 >
550550 // expected-error@+1 {{'tosa.conv2d' op operand #0 must be 4-d tosa-conformant tensor, but got 'tensor<1x29x0x4xf32>'}}
551551 %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 >
553553 return %0 : tensor <1 x27 x27 x16 xf32 >
554554}
555555
556556// -----
557557
558558func.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 >
561561 // expected-error@+1 {{'tosa.conv2d' op operand #0 must be 4-d tosa-conformant tensor, but got 'tensor<1x?x0x4xf32>'}}
562562 %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 >
564564 return %0 : tensor <1 x27 x27 x16 xf32 >
565565}
566566
@@ -1046,6 +1046,7 @@ func.func @test_shape_type(%arg0: !tosa.shape<-1>) -> !tosa.shape<-1> {
10461046}
10471047
10481048// -----
1049+
10491050func.func @test_const_shape () -> !tosa.shape <4 > {
10501051 // expected-error@+1 {{'tosa.const_shape' op attribute 'value' failed to satisfy constraint: index elements attribute}}
10511052 %cst = tosa.const_shape {value = dense <[1 , 2 , 3 , 4 ]> : tensor <4 xi32 >} : () -> !tosa.shape <4 >
0 commit comments