[Mlir-commits] [mlir] [mlir][tosa] Fix ability to expand ranks with dynamic shape support (PR #128037)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 20 09:45:29 PST 2025


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

None

>From 5118df7dc32669739fe6219d4bfc266e16d3fa0f Mon Sep 17 00:00:00 2001
From: Suraj Sudhir <suraj.sudhir at arm.com>
Date: Thu, 21 Mar 2024 23:02:32 +0000
Subject: [PATCH] [mlir][tosa] Fix ability to expand ranks with dynamic shape
 support

Signed-off-by: Suraj Sudhir <suraj.sudhir at arm.com>
Change-Id: I0f223f335667b2e32c43d4370f0a4b11b0617694
---
 mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp b/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
index d1a8732dac212..9ade05c8f095b 100644
--- a/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
+++ b/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
@@ -88,9 +88,9 @@ computeReshapeOutput(ArrayRef<int64_t> higherRankShape,
     higherRankDim = higherRankShape[i];
     lowerRankDim = lowerRankShape[j];
 
-    if (lowerRankDim == 1 && higherRankDim > 1)
+    if (lowerRankDim == 1 && higherRankDim != 1)
       reshapeOutputShape[i] = 1;
-    else if ((lowerRankDim > 1 && higherRankDim == 1) ||
+    else if ((lowerRankDim != 1 && higherRankDim == 1) ||
              (lowerRankDim == higherRankDim))
       reshapeOutputShape[i] = lowerRankDim;
     else if (higherRankDim != lowerRankDim)



More information about the Mlir-commits mailing list