Skip to content
Snippets Groups Projects
Commit cd79e1c3 authored by Noam Zerah's avatar Noam Zerah
Browse files

Fixing resetInput() with MetaOps

parent 80e695e1
No related branches found
No related tags found
No related merge requests found
Pipeline #68193 failed
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "aidge/scheduler/SequentialScheduler.hpp" #include "aidge/scheduler/SequentialScheduler.hpp"
#include "aidge/scheduler/Scheduler.hpp" #include "aidge/scheduler/Scheduler.hpp"
#include "aidge/utils/Log.hpp" #include "aidge/utils/Log.hpp"
#include "aidge/operator/MetaOperator.hpp"
#include "aidge/operator/Producer.hpp" #include "aidge/operator/Producer.hpp"
#include "aidge/operator/Mul.hpp" #include "aidge/operator/Mul.hpp"
...@@ -59,12 +60,19 @@ bool isNotQuantized(std::shared_ptr<Node> node) ...@@ -59,12 +60,19 @@ bool isNotQuantized(std::shared_ptr<Node> node)
} }
void clearGraphViewInputNodes(std::shared_ptr<GraphView> graphView,DataType targetType) void clearGraphViewInputNodes(std::shared_ptr<GraphView> graphView,DataType targetType)
{ {
for (std::shared_ptr<Aidge::Node> input_node: graphView->inputNodes()) for (std::shared_ptr<Aidge::Node> inputNode: graphView->inputNodes())
{ {
auto cast_node = Cast(targetType); if(expandMetaOp(inputNode)) //Reset Tensor does not work on MetaOps
cast_node->addChild(input_node); {
graphView->add(cast_node); inputNode = std::static_pointer_cast<MetaOperator_Op>(inputNode->getOperator())->getMicroGraph()->getOrderedNodes()[0];
}
for (Aidge::IOIndex_t index = inputNode->getFirstFreeDataInput();index < inputNode->getNbFreeDataInputs(); index++)
{
std::shared_ptr<OperatorTensor> firstOperatorTensor = std::static_pointer_cast<OperatorTensor>(inputNode->getOperator());
firstOperatorTensor->resetInput(inputNode->getFirstFreeDataInput());
}
} }
} }
bool checkArchitecture(std::shared_ptr<GraphView> graphView) bool checkArchitecture(std::shared_ptr<GraphView> graphView)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment