[Mlir-commits] [mlir] [MLIR][TOSA] Add ERROR_IF checks to TRANSPOSE_CONV2D verifer (PR #133234)
Luke Hutton
llvmlistbot at llvm.org
Fri Mar 28 03:08:47 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];
----------------
lhutton1 wrote:
In the dialect these are currently int64 (see https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td#L216), though I agree these should probably be changed to conform to the spec at some point
https://github.com/llvm/llvm-project/pull/133234
More information about the Mlir-commits
mailing list