[Mlir-commits] [mlir] [mlir][tosa] Add ERROR_IF checks to TRANSPOSE_CONV2D verifier (PR #133234)
Luke Hutton
llvmlistbot at llvm.org
Wed Apr 2 08:46:08 PDT 2025
================
@@ -2896,6 +2896,118 @@ LogicalResult TransposeConv2DOp::inferReturnTypeComponents(
LogicalResult TransposeConv2DOp::verify() {
if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed())
return failure();
+
+ const llvm::ArrayRef<int64_t> strides = getStride();
+ const int64_t strideY = strides[0];
+ const int64_t strideX = strides[1];
+
+ if (strideY < 1 || strideX < 1)
+ return emitOpError("expect all stride values to be >= 1, got [")
+ << strides << "]";
+
+ const auto inputType = llvm::dyn_cast<RankedTensorType>(getInput().getType());
----------------
lhutton1 wrote:
nit: I think there's a slight bit of readability value in moving these casts to where they're used
https://github.com/llvm/llvm-project/pull/133234
More information about the Mlir-commits
mailing list