[Mlir-commits] [mlir] [mlir][tosa] Add several level checks (PR #128074)

Luke Hutton llvmlistbot at llvm.org
Tue Feb 25 03:59:29 PST 2025


================
@@ -153,6 +479,14 @@ func.func @test_const_ui8(%arg0 : tensor<1xui8>) {
 
 // -----
 
+func.func @test_identity(%arg0: tensor<1x1x1x1x13x21x3xi32>) -> tensor<1x1x1x1x13x21x3xi32> {
+  // expected-error at +1 {{'tosa.identity' op failed level check: operand rank(shape) <= MAX_RANK}}
+  %0 = tosa.identity %arg0 : (tensor<1x1x1x1x13x21x3xi32>) -> tensor<1x1x1x1x13x21x3xi32>
+  return %0 : tensor<1x1x1x1x13x21x3xi32>
+}
+
+// -----
+
----------------
lhutton1 wrote:

It would also be good to test the scalar tensor case as well

https://github.com/llvm/llvm-project/pull/128074


More information about the Mlir-commits mailing list