@@ -368,79 +368,6 @@ func.func @test_pad_padding_shape_mismatch(%arg0: tensor<13x21x3xf32>) -> tensor
368368
369369// -----
370370
371- func.func @test_transpose_io_rank_mismatch (%arg0: tensor <13 x21 x3 xf32 >, %arg1: tensor <3 xi32 >) -> tensor <3 x13 x21 x1 xf32 > {
372- // expected-error@+1 {{'tosa.transpose' op expected input tensor rank to equal result tensor rank}}
373- %0 = tosa.transpose %arg0 {perms = array<i32 : 2 , 1 , 0 >}: (tensor <13 x21 x3 xf32 >) -> tensor <3 x13 x21 x1 xf32 >
374- return %0 : tensor <3 x13 x21 x1 xf32 >
375- }
376-
377- // -----
378-
379- func.func @test_transpose_rank0_perms () {
380- %14 = tensor.empty () : tensor <5 x27 xi64 >
381- // expected-error@+1 {{'tosa.transpose' op expected perms attribute to have size 2 (input rank) but got size 0}}
382- %72 = tosa.transpose %14 {perms = array<i32 > }: (tensor <5 x27 xi64 >) -> tensor <?x?xi64 >
383- return
384- }
385-
386- // -----
387-
388- func.func @test_transpose_invalid_perms_size (%arg0: tensor <13 x21 x3 xf32 >) -> tensor <3 x13 x21 xf32 > {
389- // expected-error@+1 {{'tosa.transpose' op expected perms attribute to have size 3 (input rank) but got size 7}}
390- %0 = tosa.transpose %arg0 {perms = array<i32 : 6 , 5 , 4 , 3 , 2 , 1 , 0 > }: (tensor <13 x21 x3 xf32 >) -> tensor <3 x13 x21 xf32 >
391- return %0 : tensor <3 x13 x21 xf32 >
392- }
393-
394- // -----
395-
396- func.func @test_transpose_invalid_permutation_tensor (%arg0: tensor <13 x21 x3 xf32 >) -> tensor <?x?x?xf32 > {
397- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
398- %0 = tosa.transpose %arg0 {perms = array<i32 : 2 , 0 , 0 > }: (tensor <13 x21 x3 xf32 >) -> tensor <?x?x?xf32 >
399- return %0 : tensor <?x?x?xf32 >
400- }
401-
402- // -----
403-
404- func.func @test_transpose_invalid_permutation_negative (%arg0: tensor <3 x2 xi32 >) -> tensor <*xi32 > {
405- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
406- %1 = tosa.transpose %arg0 {perms = array<i32 : -1 , 0 > }: (tensor <3 x2 xi32 >) -> tensor <*xi32 >
407- return %1 : tensor <*xi32 >
408- }
409-
410- // -----
411-
412- func.func @test_transpose_invalid_permutation_tensor_above_range (%arg0: tensor <3 x2 xi32 >) -> tensor <*xi32 > {
413- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
414- %1 = tosa.transpose %arg0 {perms = array<i32 : 2 , 0 > }: (tensor <3 x2 xi32 >) -> tensor <*xi32 >
415- return %1 : tensor <*xi32 >
416- }
417-
418- // -----
419-
420- func.func @test_transpose_invalid_permutation_types (%arg0: tensor <3 x2 xi32 >) -> tensor <3 x4 xi32 > {
421- // expected-error@+1 {{'tosa.transpose' op expected output tensor dim 0 to match input dim 1 with value of 2}}
422- %1 = tosa.transpose %arg0 {perms = array<i32 : 1 , 0 > }: (tensor <3 x2 xi32 >) -> tensor <3 x4 xi32 >
423- return %1 : tensor <3 x4 xi32 >
424- }
425-
426- // -----
427-
428- func.func @test_transpose_invalid_permutation_types_dynamic_dim_ok (%arg0: tensor <2 x?xi32 >) -> tensor <3 x4 xi32 > {
429- // expected-error@+1 {{'tosa.transpose' op expected output tensor dim 1 to match input dim 0 with value of 2}}
430- %1 = tosa.transpose %arg0 {perms = array<i32 : 1 , 0 > }: (tensor <2 x?xi32 >) -> tensor <3 x4 xi32 >
431- return %1 : tensor <3 x4 xi32 >
432- }
433-
434- // -----
435-
436- func.func @test_transpose_element_type_mismatch (%arg0: tensor <2 x3 xi32 >) -> tensor <3 x2 xf32 > {
437- // expected-error@+1 {{'tosa.transpose' op failed to verify that all of {input1, output} have same element type}}
438- %1 = tosa.transpose %arg0 {perms = array<i32 : 1 , 0 >} : (tensor <2 x3 xi32 >) -> tensor <3 x2 xf32 >
439- return %1 : tensor <3 x2 xf32 >
440- }
441-
442- // -----
443-
444371func.func @test_reduce_sum_type_mismatch (%arg0 : tensor <2 x3 x4 x5 xf32 >) -> () {
445372 // expected-error@+2 {{failed to infer returned types}}
446373 // expected-error@+1 {{'tosa.reduce_sum' op inferred type(s) 'tensor<1x3x4x5xf32>' are incompatible with return type(s) of operation 'tensor<1x3x4x5xi32>'}}
@@ -783,37 +710,6 @@ func.func @test_tile_io_rank_mismatch() {
783710 return
784711}
785712
786- // -----
787-
788- // CHECK-LABEL: @test_invalid_constant_permutation
789- func.func @test_invalid_constant_permutation () {
790- %0 = tensor.empty () : tensor <3 x4 x5 xi32 >
791- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
792- %2 = tosa.transpose %0 {perms = array<i32 : 3 , 0 , 1 >}: (tensor <3 x4 x5 xi32 >) -> tensor <3 x4 x5 xi32 >
793- return
794- }
795-
796- // -----
797-
798- // CHECK-LABEL: test_rank_size_constant_permutation
799- func.func @test_rank_size_constant_permutation () {
800- %0 = arith.constant 6 : index
801- %2 = tensor.empty (%0 ) : tensor <?x27 xi64 >
802- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
803- %3 = tosa.transpose %2 {perms = array<i32 : 0 , 2 >}: (tensor <?x27 xi64 >) -> tensor <?x27 xi64 >
804- return
805- }
806-
807- // -----
808-
809- // CHECK-LABEL: test_large_constant_permutation
810- func.func @test_large_constant_permutation () {
811- %0 = arith.constant 6 : index
812- %2 = tensor.empty (%0 ) : tensor <?x27 xi64 >
813- // expected-error@+1 {{'tosa.transpose' op expected valid permutation indices}}
814- %3 = tosa.transpose %2 {perms = array<i32 : 1185677355 , 332462212 >}: (tensor <?x27 xi64 >) -> tensor <?x27 xi64 >
815- return
816- }
817713
818714// -----
819715
@@ -2061,14 +1957,6 @@ func.func @test_scalar_tile(%arg0: tensor<f32>) -> tensor<*xf32> {
20611957
20621958// -----
20631959
2064- func.func @test_scalar_output_transpose (%arg0: tensor <*xf32 >) -> tensor <f32 > {
2065- // expected-error@+1 {{'tosa.transpose' op result #0 must be tosa-conformant tensor of at least rank 1, but got 'tensor<f32>'}}
2066- %1 = tosa.transpose %arg0 {perms = array<i32 : 2 , 0 , 1 >} : (tensor <*xf32 >) -> tensor <f32 >
2067- return %1 : tensor <f32 >
2068- }
2069-
2070- // -----
2071-
20721960// CHECK-LABEL: test_add_i1
20731961func.func @test_add_i1 (%arg0: tensor <13 x21 x1 xi1 >, %arg1: tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 > {
20741962 // expected-error@+1 {{'tosa.add' op illegal: operand/result data types not supported}}
0 commit comments