[Mlir-commits] [mlir] [mlir][tosa] Add more verifiers for the following operators (PR #127923)

Jack Frankland llvmlistbot at llvm.org
Wed Mar 5 08:46:45 PST 2025


================
@@ -920,6 +989,57 @@ LogicalResult tosa::MatMulOp::inferReturnTypeComponents(
   return success();
 }
 
+LogicalResult MatMulOp::verify() {
+  auto aType = llvm::dyn_cast<ShapedType>(getA().getType());
+  auto bType = llvm::dyn_cast<ShapedType>(getB().getType());
+
+  // Must be shaped tensor types
+  if (!aType) {
+    emitOpError("expect a shaped tensor for input a, got ") << getA().getType();
----------------
FranklandJack wrote:

Sorry what I meant was that you could write this as:
```

return mitOpError("expect a shaped tensor for input a, got ") << getA().getType();
```

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


More information about the Mlir-commits mailing list