From c32ec336794f7eddd8e2a62d5594502d360525f7 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Thu, 16 May 2024 14:12:19 +0000 Subject: [PATCH] Fix Node::operator() that wrongly checked each input instead of data only --- src/graph/Node.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/graph/Node.cpp b/src/graph/Node.cpp index b08bb4c20..95c10ca38 100644 --- a/src/graph/Node.cpp +++ b/src/graph/Node.cpp @@ -39,11 +39,15 @@ Aidge::Node::Node(std::shared_ptr<Operator> op, const std::string& name) Aidge::Connector Aidge::Node::operator()(const std::vector<Connector>& ctors) { assert((ctors.size() == nbData()) && "Wrong number of arguments.\n"); - for (std::pair<std::shared_ptr<Node>, IOIndex_t>& input : inputs()) { - assert((gk_IODefaultIndex == input.second) && + for (std::size_t i = 0; i < nbData(); i++) { + assert((gk_IODefaultIndex == input(i).second) && "At least one input connection is not free.\n"); - (void)input; // avoid unused warning } + // for (std::pair<std::shared_ptr<Node>, IOIndex_t>& input : inputs()) { + // assert((gk_IODefaultIndex == input.second) && + // "At least one input connection is not free.\n"); + // (void)input; // avoid unused warning + // } IOIndex_t i = 0; for (const Connector& ctor : ctors) { if (ctor.node() != nullptr) { // ctor must be associated with a node -- GitLab