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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 5 08:58:19 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();
----------------
Jerry-Ge wrote:

ah, thanks. Updated the code and other similar cases. 

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


More information about the Mlir-commits mailing list