Skip to content

Commit 4f51fbd

Browse files
authored
Add tests
1 parent bab92d0 commit 4f51fbd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mlir/test/Dialect/Tosa/invalid.mlir

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,22 @@ func.func @test_pad_invalid_padConst_rank(%arg0: tensor<13x21xf32>, %arg1: tenso
119119

120120
// -----
121121

122+
func.func @test_pad_padding_shape_mismatch(%arg0: tensor<13x21x3xf32>, %arg1: tensor<2x2xi32>) -> tensor<13x21x3xf32> {
123+
// expected-error@+1 {{'tosa.pad' op expect 'padding' tensor shape to match [rank(input), 2]}}
124+
%0 = tosa.pad %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<2x2xi32>) -> tensor<13x21x3xf32>
125+
return %0 : tensor<13x21x3xf32>
126+
}
127+
128+
// -----
129+
130+
func.func @test_pad_padding_shape_mismatch(%arg0: tensor<13x21x3xf32>, %arg1: tensor<3x1xi32>) -> tensor<13x21x3xf32> {
131+
// expected-error@+1 {{'tosa.pad' op expect 'padding' tensor shape to match [rank(input), 2]}}
132+
%0 = tosa.pad %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<3x1xi32>) -> tensor<13x21x3xf32>
133+
return %0 : tensor<13x21x3xf32>
134+
}
135+
136+
// -----
137+
122138
func.func @test_transpose_non_const(%arg0: tensor<13x21x3xf32>, %arg1: tensor<3xi32>) -> tensor<3x13x21xf32> {
123139
// expected-error@+1 {{'tosa.transpose' op perms of transpose is not constant}}
124140
%0 = tosa.transpose %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<3xi32>) -> tensor<3x13x21xf32>

0 commit comments

Comments
 (0)