diff --git a/src/backend/OperatorImpl.cpp b/src/backend/OperatorImpl.cpp index 1708d9e36c174527c648e37b63b080211aa6df05..c74b538a4e566b3b88e77dd4d097344d52838505 100644 --- a/src/backend/OperatorImpl.cpp +++ b/src/backend/OperatorImpl.cpp @@ -95,7 +95,7 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs) Log::debug("getBestMatch() for requirements: {}", requiredSpecs); const auto availableSpecsSet = getAvailableImplSpecs(); - AIDGE_ASSERT(availableSpecsSet.size() > 0 , + AIDGE_ASSERT(availableSpecsSet.size() > 0 , "OperatorImpl::getBestMatch(): No available specs found by" "getAvailableSpecs(). " "Cannot find best implementation for required specs, aborting."); @@ -139,7 +139,7 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs) if (mandatory) { // Required attribute: if (!spec.attrs.hasAttr(name)) { - Log::debug("Could not find mandatory attribute {} value {}.", name); + Log::debug("Could not find mandatory attribute '{}'.", name); // Missing attribute match = false; break; diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index 1354281933b69bb6e038587cc27ee0397d05c6f1..465359757eadd2799aa7f272e2d85b032a60cfdd 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -157,15 +157,15 @@ void Aidge::GraphView::save(const std::string& path, bool verbose, bool showProd const auto op = std::dynamic_pointer_cast<OperatorTensor>(node_ptr->getOperator()); if (op && !op->getOutput(outputIdx)->undefined()) { dims += " " + fmt::format("{}", op->getOutput(outputIdx)->dims()); - dtype += "\n" + fmt::format("{}", op->getOutput(outputIdx)->dataType()); + dtype += " " + fmt::format("{}", op->getOutput(outputIdx)->dataType()); } if (mNodes.find(child) != mNodes.end()) { - fmt::print(fp.get(), "{}_{}-->|\"{}{}{}→{}\"|{}_{}\n", node_ptr->type(), namePtrTable.at(node_ptr), + fmt::print(fp.get(), "{}_{}-->|\"{}{}{}<br/>↓<br/>{}\"|{}_{}\n", node_ptr->type(), namePtrTable.at(node_ptr), outputIdx, dims, dtype, inputIdx, child->type(), namePtrTable.at(child)); } else if (verbose) { - fmt::print(fp.get(), "{}_{}-->|\"{}{}{}→{}\"|{}:::externalCls\n", node_ptr->type(), namePtrTable.at(node_ptr), + fmt::print(fp.get(), "{}_{}-->|\"{}{}{}<br/>↓<br/>{}\"|{}:::externalCls\n", node_ptr->type(), namePtrTable.at(node_ptr), outputIdx, dims, dtype, inputIdx, static_cast<void*>(child.get())); } // Do no break here because the same child can be connected to several inputs @@ -182,11 +182,13 @@ void Aidge::GraphView::save(const std::string& path, bool verbose, bool showProd for (const auto& input : mInputNodes) { if (input.first != nullptr) { const auto& op_ = std::dynamic_pointer_cast<OperatorTensor>(input.first->getOperator()); - if (op_->getInput(input.second) && (!op_->getInput(input.second)->empty())) { - fmt::print(fp.get(), "input{}((in#{})):::inputCls--->|\"→{}{}\"|{}_{}\n", inputIdx, inputIdx, - input.second, op_->getInput(input.second)->dims(), input.first->type(), namePtrTable.at(input.first)); + if (op_->getInput(input.second) && (!op_->getInput(input.second)->undefined())) { + std::string dims = " " + fmt::format("{}", op_->getInput(input.second)->dims()); + std::string dtype = " " + fmt::format("{}", op_->getInput(input.second)->dataType()); + fmt::print(fp.get(), "input{}((in#{})):::inputCls--->|\"{}{}<br/>↓<br/>{}\"|{}_{}\n", inputIdx, inputIdx, + dims, dtype, input.second, input.first->type(), namePtrTable.at(input.first)); } else { - fmt::print(fp.get(), "input{}((in#{})):::inputCls--->|\"→{}\"|{}_{}\n", inputIdx, inputIdx, + fmt::print(fp.get(), "input{}((in#{})):::inputCls--->|\"↓<br/>{}\"|{}_{}\n", inputIdx, inputIdx, input.second, input.first->type(), namePtrTable.at(input.first)); } } @@ -201,14 +203,16 @@ void Aidge::GraphView::save(const std::string& path, bool verbose, bool showProd if (output.first != nullptr) { // Add-on to display the operator's output dimensions std::string dims = ""; + std::string dtype = ""; const auto op = std::dynamic_pointer_cast<OperatorTensor>(output.first->getOperator()); if (op && op->getOutput(output.second) && !op->getOutput(output.second)->undefined()) { dims += " " + fmt::format("{}", op->getOutput(output.second)->dims()); + dtype += " " + fmt::format("{}", op->getOutput(output.second)->dataType()); } - fmt::print(fp.get(), "{}_{}--->|\"{}{}→\"|output{}((out#{})):::outputCls\n", + fmt::print(fp.get(), "{}_{}--->|\"{}{}{}<br/>↓\"|output{}((out#{})):::outputCls\n", output.first->type(), namePtrTable.at(output.first), output.second, - dims, outputIdx, outputIdx); + dims, dtype, outputIdx, outputIdx); } else { fmt::print(fp.get(), "output{}((out#{})):::outputCls\n", outputIdx, outputIdx); @@ -1236,7 +1240,6 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const if (removeFromGraphs) { for (const auto& g : commonGraphViews) { g -> remove(nodePtr, false); - g -> updateInputsOutputsDelete(nodePtr); } nodePtr -> resetConnections(true); } diff --git a/src/operator/OperatorTensor.cpp b/src/operator/OperatorTensor.cpp index 586dbc2037d36d26f39dd06404b3b70b99270c1e..3bdb4b17127eb8a9115f8dec045db32bf041b00b 100644 --- a/src/operator/OperatorTensor.cpp +++ b/src/operator/OperatorTensor.cpp @@ -88,7 +88,7 @@ std::shared_ptr<Aidge::Data> Aidge::OperatorTensor::getRawOutput(const Aidge::IO } const std::shared_ptr<Aidge::Tensor>& Aidge::OperatorTensor::getOutput(const Aidge::IOIndex_t outputIdx) const { - AIDGE_ASSERT(outputIdx < nbOutputs(), "{} Operator has {} outputs", type(), nbOutputs()); + AIDGE_ASSERT(outputIdx < nbOutputs(), "{} Operator has {} outputs, asked for output#{}", type(), nbOutputs(), outputIdx); return mOutputs[outputIdx]; }