From 8b016d0ceefd8fbe47946aa350b8731ab8f5de83 Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Wed, 9 Oct 2024 14:53:18 +0200 Subject: [PATCH] Fixed Meta op and Generic op clone bugs --- src/graph/GraphView.cpp | 7 ++++++- src/operator/GenericOperator.cpp | 1 + src/operator/MetaOperator.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index 16edfab64..f7b6b97cd 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -522,6 +522,9 @@ bool Aidge::GraphView::forwardDims(const std::vector<std::vector<Aidge::DimSize_ } if (parentsForwarded && op->forwardDims(allowDataDependency)) { + Log::debug("Dimensions forwarded for node {} (of type {})", + nodePtr->name(), nodePtr->type()); + // Recompute everytime, even if it was already computed in a // previous call of forwardDims(), as the graph may have changed! dimsForwarded.insert(nodePtr); @@ -532,7 +535,9 @@ bool Aidge::GraphView::forwardDims(const std::vector<std::vector<Aidge::DimSize_ } } else { - Log::debug("Unable to forward dimensions for node {} (of type {}) yet", nodePtr->name(), nodePtr->type()); + if (parentsForwarded) { + Log::debug("Unable to forward dimensions for node {} (of type {})", nodePtr->name(), nodePtr->type()); + } nextList.insert(nodePtr); } } diff --git a/src/operator/GenericOperator.cpp b/src/operator/GenericOperator.cpp index e8c66085d..0f90a5a58 100644 --- a/src/operator/GenericOperator.cpp +++ b/src/operator/GenericOperator.cpp @@ -43,6 +43,7 @@ Aidge::GenericOperator_Op::GenericOperator_Op(const std::string& type, Aidge::GenericOperator_Op::GenericOperator_Op(const Aidge::GenericOperator_Op& op) : OperatorTensor(op), + mForwardDims(op.mForwardDims), mAttributes(op.attributes() ? op.mAttributes : std::make_shared<DynamicAttributes>()) { mImpl = std::make_shared<OperatorImpl>(*this, op.backend()); diff --git a/src/operator/MetaOperator.cpp b/src/operator/MetaOperator.cpp index e3acba9b4..1a7173747 100644 --- a/src/operator/MetaOperator.cpp +++ b/src/operator/MetaOperator.cpp @@ -46,7 +46,7 @@ Aidge::MetaOperator_Op::MetaOperator_Op(const std::string& type, const std::shar } std::shared_ptr<Aidge::Operator> Aidge::MetaOperator_Op::clone() const { - return std::make_shared<MetaOperator_Op>(*this); + return std::make_shared<MetaOperator_Op>(type(), mGraph->clone()); } void Aidge::MetaOperator_Op::associateInput(const IOIndex_t inputIdx, const std::shared_ptr<Data>& data) { -- GitLab