[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:24:39 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)
----------------
ekalda wrote:

It could :) But considering that we need to extract the individual stride values anyway (we need them in the checks below), I believe that in this specific case we derive more benefit from the readability of the current code than from the generality of the suggestion. We could always change this in the future if there appears a need for a more general approach.

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


More information about the Mlir-commits mailing list