[Mlir-commits] [mlir] [mlir][tosa] Add parenthesis for the weight padding calculation (PR #134420)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Apr 4 10:21:15 PDT 2025


https://github.com/Jerry-Ge created https://github.com/llvm/llvm-project/pull/134420

Minor change. 

>From 2a685c8da45fccf06e8826f55f361cc6e5e7453f Mon Sep 17 00:00:00 2001
From: Jerry Ge <jerry.ge at arm.com>
Date: Fri, 4 Apr 2025 10:19:31 -0700
Subject: [PATCH] [mlir][tosa] Add parenthesis for the weight padding
 calculation

Signed-off-by: Jerry Ge <jerry.ge at arm.com>
Change-Id: I251be1dd22f43562537d66710ac1f0a86e42f2e0
---
 mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp
index 50d2202f68a87..ea6ac981b53cc 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp
@@ -129,7 +129,7 @@ class TransposeConvStridedConverter
     weightPadding[3] =
         (weightHeight % stride[0]) ? (stride[0] - weightHeight % stride[0]) : 0;
     weightPadding[5] =
-        weightWidth % stride[1] ? stride[1] - weightWidth % stride[1] : 0;
+        (weightWidth % stride[1]) ? (stride[1] - weightWidth % stride[1]) : 0;
 
     Value weightPaddingVal =
         getTosaConstShape(rewriter, op->getLoc(), weightPadding);



More information about the Mlir-commits mailing list