From c82911a563a9cf6cabe0b725ebe8d548f7f3c27a Mon Sep 17 00:00:00 2001
From: cmoineau <cyril.moineau@cea.fr>
Date: Tue, 4 Mar 2025 15:50:03 +0000
Subject: [PATCH] Fix issue with return value of constantShapeFolding

---
 src/recipes/ShapeFolding.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/recipes/ShapeFolding.cpp b/src/recipes/ShapeFolding.cpp
index f869e646b..ca6ef5087 100644
--- a/src/recipes/ShapeFolding.cpp
+++ b/src/recipes/ShapeFolding.cpp
@@ -24,6 +24,7 @@ bool Aidge::constantShapeFolding(std::shared_ptr<GraphView> graph, const std::ve
     bool modified      = false;
     bool forwarded     = false;
     bool not_shape_present = true;
+    bool was_modified = false;
     for (auto nodePtr: graph->getNodes())
         not_shape_present &= (nodePtr->type() != Shape_Op::Type);
     if (not_shape_present)
@@ -31,10 +32,11 @@ bool Aidge::constantShapeFolding(std::shared_ptr<GraphView> graph, const std::ve
     do{
         forwarded = graph->forwardDims(dims, true);
         modified = constantFolding(graph, true);
+        was_modified = true;
     } while(modified);
     if (!forwarded){
         Log::warn("Failed to forward GraphView.");
     }
 
-    return modified;
+    return was_modified;
 }
-- 
GitLab