[Mlir-commits] [mlir] [MLIR][TOSA] Add ERROR_IF checks to TRANSPOSE_CONV2D verifer (PR #133234)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Mar 27 15:20:07 PDT 2025
================
@@ -2896,6 +2896,103 @@ LogicalResult TransposeConv2DOp::inferReturnTypeComponents(
LogicalResult TransposeConv2DOp::verify() {
if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed())
return failure();
+
+ const RankedTensorType weightType =
+ llvm::dyn_cast<RankedTensorType>(getWeight().getType());
+ if (!weightType)
+ return success();
+
+ const int64_t kernelHeight = weightType.getDimSize(1);
+ const int64_t kernelWidth = weightType.getDimSize(2);
+
+ // Skip further checks if kernel dimensions are dynamic
+ if (kernelHeight == ShapedType::kDynamic ||
+ kernelWidth == ShapedType::kDynamic)
+ return success();
+
+ llvm::ArrayRef<int64_t> padding = getOutPad();
+ const int64_t outPadTop = padding[0];
----------------
Jerry-Ge wrote:
isn't `out_pad` is of type `i32_t`? https://www.mlplatform.org/tosa/tosa_spec.html#_transpose_conv2d
https://github.com/llvm/llvm-project/pull/133234
More information about the Mlir-commits
mailing list