[Mlir-commits] [mlir] [mlir][tosa] Add verifier for `tosa.transpose` (PR #75376)

Kai Sasaki llvmlistbot at llvm.org
Wed Dec 13 23:06:33 PST 2023


================
@@ -1054,6 +1055,46 @@ LogicalResult tosa::TransposeOp::inferReturnTypeComponents(
   return success();
 }
 
+LogicalResult tosa::TransposeOp::verify() {
+  TensorType inputType = getInput1().getType();
+  TensorType permType = getPerms().getType();
+  TensorType outputType = getOutput().getType();
+
+  if (permType.hasRank() && permType.getRank() != 1)
----------------
Lewuathe wrote:

The [TOSA spec](https://www.mlplatform.org/tosa/tosa_spec.html#_transpose) does not allow the non-one rank. It makes sense.

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


More information about the Mlir-commits mailing list