Skip to content

HotFix: Segfault in the PTQ when using a model without bias

Noam Zerah requested to merge noamzerah/aidge_quantization:fix_cuda into dev

File modified: PTQ.cpp
Function: getBiasTensor()

Change summary:
Added a conditional check to ensure that if the bias tensor is not a producer , the function returns nullptr.
This prevents a potential segmentation fault caused by attempting to cast and access the output of a non-existent producer:

std::static_pointer_cast<OperatorTensor>(producer->getOperator())->getOutput(0)

Returning nullptr in this case correctly signals the absence of a bias tensor.

Edited by Noam Zerah

Merge request reports

Loading