[Mlir-commits] [mlir] [mlir][tosa] Add ERROR_IF checks to TRANSPOSE_CONV2D verifier (PR #133234)
Elen Kalda
llvmlistbot at llvm.org
Wed Apr 2 02:26:24 PDT 2025
================
@@ -2896,6 +2896,114 @@ LogicalResult TransposeConv2DOp::inferReturnTypeComponents(
LogicalResult TransposeConv2DOp::verify() {
if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed())
return failure();
+
+ 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 RankedTensorType inputType =
+ llvm::dyn_cast<RankedTensorType>(getInput().getType());
+
+ const RankedTensorType outputType =
+ llvm::dyn_cast<RankedTensorType>(getOutput().getType());
+
+ const RankedTensorType weightType =
+ llvm::dyn_cast<RankedTensorType>(getWeight().getType());
+
+ llvm::ArrayRef<int64_t> padding = getOutPad();
+
+ const auto checkPadAgainstKernelDim =
+ [this](const int64_t pad_value, const int64_t kernel_dim_size,
----------------
ekalda wrote:
Good spot, I don't think the const makes any difference in this case, removed it.
https://github.com/llvm/llvm-project/pull/133234
More information about the Mlir-commits
mailing list