Skip to content

[quantization] Quantize network with optimized signs

Problem

Returns SegFault when quantizing with optimized signs argument = True.

When loading the LeNet and expanding meta operators, the first node Conv with pad is split into Pad -> Conv.

This line raise a segFault https://gitlab.eclipse.org/eclipse/aidge/aidge_quantization/-/blob/dev/src/PTQ/PTQ.cpp?ref_type=heads#L702

The Pad node does not have any parents as it is the inputNode of the graph.

Proposed fix

   if (node->type() == "ReLU" || isSeamless(node))
        {
            // Thoses nodes always have a single parent 
            std::shared_ptr<Node> parent = node->getParent(0); 
            if (parent)
            {
                signMap[node->name()].first = signMap[parent->name()].second;
                signMap[node->name()].second = signMap[node->name()].first;
            }
            
        }