Skip to content
Snippets Groups Projects

Real quantization cast for PTQ

Merged Noam Zerah requested to merge noamzerah/aidge_quantization:quantization_cast into dev
1 file
+ 4
5
Compare changes
  • Side-by-side
  • Inline
+ 4
5
@@ -85,10 +85,9 @@ void clearGraphViewInputNodes(std::shared_ptr<GraphView> graphView,DataType targ
{
for (std::shared_ptr<Aidge::Node> input_node: graphView->inputNodes())
{
for (Aidge::IOIndex_t index = input_node->getFirstFreeDataInput();index < input_node->getNbFreeDataInputs(); index++)
{
std::static_pointer_cast<OperatorTensor>(input_node->getOperator())->resetInput(index);
}
auto cast_node = Cast(targetType);
cast_node->addChild(input_node);
graphView->add(cast_node);
}
}
bool checkArchitecture(std::shared_ptr<GraphView> graphView)
@@ -1367,7 +1366,7 @@ void quantizeNetwork(std::shared_ptr<GraphView> graphView,
Log::notice("Starting to cast operators into the desired type ...");
castQuantizedGraph(graphView,targetType,singleShift,bitshiftRounding);
graphView->updateInputsOutputs();
//clearGraphViewInputNodes(graphView,targetType); //Convert all input tensors of the GV into targetType
clearGraphViewInputNodes(graphView,targetType); //Convert all input tensors of the GV into targetType
}
else
{
Loading