From f79f0ab2451859187928a392a3e407a5f586dfbf Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Thu, 10 Apr 2025 22:14:24 +0200
Subject: [PATCH] Fixed attributes cloning

---
 include/aidge/operator/LSQ.hpp | 2 +-
 src/operator/FixedQ.cpp        | 2 +-
 src/operator/SAT/DoReFa.cpp    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/aidge/operator/LSQ.hpp b/include/aidge/operator/LSQ.hpp
index 970c476..b6abf90 100644
--- a/include/aidge/operator/LSQ.hpp
+++ b/include/aidge/operator/LSQ.hpp
@@ -55,7 +55,7 @@ public:
      */
     LSQ_Op(const LSQ_Op& op)
         : OperatorTensor(op),
-          mAttributes(op.mAttributes)
+          mAttributes(std::make_shared<Attributes_>(*op.mAttributes))
     {
         if (op.mImpl){
             SET_IMPL_MACRO(LSQ_Op, *this, op.backend());
diff --git a/src/operator/FixedQ.cpp b/src/operator/FixedQ.cpp
index 9828ce9..ce9a65d 100644
--- a/src/operator/FixedQ.cpp
+++ b/src/operator/FixedQ.cpp
@@ -22,7 +22,7 @@ const std::string Aidge::FixedQ_Op::Type = "FixedQ";
 
 Aidge::FixedQ_Op::FixedQ_Op(const Aidge::FixedQ_Op& op)
     : OperatorTensor(op),
-      mAttributes(op.mAttributes)
+      mAttributes(std::make_shared<Attributes_>(*op.mAttributes))
 {
     if (op.mImpl){
         SET_IMPL_MACRO(FixedQ_Op, *this, op.backend());
diff --git a/src/operator/SAT/DoReFa.cpp b/src/operator/SAT/DoReFa.cpp
index 426e330..f722631 100644
--- a/src/operator/SAT/DoReFa.cpp
+++ b/src/operator/SAT/DoReFa.cpp
@@ -23,7 +23,7 @@ const std::string DoReFa_Op::Type = "DoReFa";
 
 DoReFa_Op::DoReFa_Op(const DoReFa_Op& op)
     : OperatorTensor(op),
-      mAttributes(op.mAttributes)
+      mAttributes(std::make_shared<Attributes_>(*op.mAttributes))
 {
     if (op.mImpl) {
         SET_IMPL_MACRO(DoReFa_Op, *this, op.backend());
-- 
GitLab