diff --git a/include/aidge/graph/GraphView.hpp b/include/aidge/graph/GraphView.hpp index e53d3b5d3736fc52fb1532e3d3e68a3505234554..383575f1b8493d76a1e17439d16917b9869ce66a 100644 --- a/include/aidge/graph/GraphView.hpp +++ b/include/aidge/graph/GraphView.hpp @@ -380,11 +380,11 @@ public: */ std::pair<std::vector<NodePtr>, size_t> getRankedNodes() const; - //@todo here i am /** + // todo see comment in code * Get the nodes name according to the GraphView nodes ranking. * @param format The formatting string to be used with fmt::format(). - * The usable positional arguments are the following: + * @details The usable positional arguments are the following: * {0} node name, {1} node type, {2} rank, {3} type rank * @param markNonUnicity If true, non unique ranking is prefixed with "?" * @return std::map<NodePtr, std::string> A map with the corresponding names @@ -395,16 +395,21 @@ public: * @brief Remove a Node from the current GraphView scope without affecting its connections. * @param nodePtr Node to remove * @param includeLearnableParam Whether learnable parameters should also be removed. Default true. + * learnable params are removed only if they aren't used by other Nodes */ void remove(NodePtr nodePtr, bool includeLearnableParam = true); // Surrounding nodes management + // not implemented yet void setInputId(IOIndex_t inID, IOIndex_t newNodeOutID); /** + //@todo here i am * @brief Include a Node to the current GraphView object. - * @param other_Nde Node to add. + * @details If the GraphView has no root Node (most likely this GraphView is empty) + * the added Node becomes the GraphView's root Node + * @param otherNode Node to add. * @param includeLearnableParam Include non-data inputs, like weights and biases * in the GraphView automatically. Default: true. */ diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index b2c03e794888a0909ada5db208fc07ad266d4ae2..fd0f1561dcadaa0cf495d410715f3f39095eecd9 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -623,7 +623,7 @@ Aidge::GraphView::outputs(const std::string& nodeName) const { void Aidge::GraphView::setInputId(Aidge::IOIndex_t /*inID*/, Aidge::IOIndex_t /*newNodeOutID*/) { - AIDGE_THROW_OR_ABORT(std::runtime_error, "Not implemented yet."); + AIDGE_THROW_OR_ABORT(std::radduntime_error, "Not implemented yet."); } void Aidge::GraphView::add(std::shared_ptr<Node> node, bool includeLearnableParam) { @@ -762,9 +762,9 @@ std::map<Aidge::NodePtr, std::string> Aidge::GraphView::getRankedNodesName(const std::map<std::string, size_t>::iterator it; std::tie(it, std::ignore) = typeRank.insert(std::make_pair(rankedNode->type(), 0)); - const auto name = (markNonUnicity && rank < rankedNodes.second) - ? fmt::format(format, rankedNode->name(), rankedNode->type(), rank, it->second) - : fmt::format(format, rankedNode->name(), rankedNode->type(), fmt::format("?{}", rank), fmt::format("?{}", it->second)); + const auto name = (markNonUnicity && rank < rankedNodes.second) //if todo logic doesn't match description, to be checked + ? fmt::format(format, rankedNode->name(), rankedNode->type(), rank, it->second) //then + : fmt::format(format, rankedNode->name(), rankedNode->type(), fmt::format("?{}", rank), fmt::format("?{}", it->second)); //else rankedNodesName.insert(std::make_pair(rankedNode, name)); ++it->second; ++rank; @@ -1009,9 +1009,9 @@ void Aidge::GraphView::remove(std::shared_ptr<Node> nodePtr, bool includeLearnab for (const auto& parentOutput : inputI.first->outputs()) { for (const auto& childOfParentOutput : parentOutput) { // only remove the learnable parameter if not related to any other Node in the GraphView - if (childOfParentOutput.first != nodePtr) { - removeNode = false; - break; + if (childOfParentOutput.first != nodePtr) { //todo isn't it possible that childOfParentOutput.first == nodePtr? + removeNode = false; // todo too deep + break; // todo only one for loop is broken, why not both? } } }