diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp index 11def52dbab30159e9e882fb19d16f1549aa3887..340a8318cbd0d59b7710bce7d46b7acd1670dd5b 100644 --- a/include/aidge/graph/Node.hpp +++ b/include/aidge/graph/Node.hpp @@ -303,7 +303,7 @@ public: * @param inId Input index. * @return std::shared_ptr<Node>& */ - inline NodePtr &getParents(const IOIndex_t inId) { + inline NodePtr &getParent(const IOIndex_t inId) { assert(inId != gk_IODefaultIndex); return mParents.at(inId); } diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index a0641032281c6bedb4459a0d08da1193d6375129..7cb4e1dcf33b71bec87ea883aceb8c8a3c49a5ba 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -326,7 +326,7 @@ void Aidge::GraphView::add(std::shared_ptr<Node> node, bool includeLearnablePara // add learnable parameters to the graph if (includeLearnableParam) { for (IOIndex_t i = node->nbDataInputs(); i < node->nbInputs(); ++i) { - std::shared_ptr<Node> parentNode = node->getParents(static_cast<IOIndex_t>(i)); + std::shared_ptr<Node> parentNode = node->getParent(static_cast<IOIndex_t>(i)); if (parentNode) { parentNode->addView(shared_from_this()); mNodes.insert(parentNode); diff --git a/src/graph/Node.cpp b/src/graph/Node.cpp index 5fcc0e1139d8ccd9368eaba90231fb12370e761e..abf572831d8f0b5c2c5eb836ea46e05b8114da55 100644 --- a/src/graph/Node.cpp +++ b/src/graph/Node.cpp @@ -226,7 +226,7 @@ void Aidge::Node::addChild(std::shared_ptr<GraphView> otherView, const IOIndex_t } void Aidge::Node::addParent(const std::shared_ptr<Node> other_node, const IOIndex_t inId) { - if (getParents(inId) != nullptr) { + if (getParent(inId) != nullptr) { printf("Warning, you're replacing a Parent.\n"); } assert((inId != gk_IODefaultIndex) && (inId < nbInputs()) && "Input index out of bound."); diff --git a/src/recipies/FuseMulAdd.cpp b/src/recipies/FuseMulAdd.cpp index dc565bf0acc7747d79ec12df973a82d86fc79503..561d25776a28f1aad8f8c943711887ec6661a10c 100644 --- a/src/recipies/FuseMulAdd.cpp +++ b/src/recipies/FuseMulAdd.cpp @@ -59,12 +59,12 @@ void Aidge::fuseMulAdd(std::set<std::shared_ptr<Node>> nodes){ // Step 2 : Branch existing producers & create the others // link weights & bias - if (matmul->getParents(1)==nullptr) { - matmul->getParents(0)->addChild(fc, 0, 1); + if (matmul->getParent(1)==nullptr) { + matmul->getParent(0)->addChild(fc, 0, 1); } else { - if (matmul->getParents(0)!=nullptr) - matmul->getParents(0)->addChild(fc, 0, 0); - matmul->getParents(1)->addChild(fc, 0, 1); + if (matmul->getParent(0)!=nullptr) + matmul->getParent(0)->addChild(fc, 0, 0); + matmul->getParent(1)->addChild(fc, 0, 1); } (producer_add_bias.first)->addChild(fc,0,2);