Skip to content
Snippets Groups Projects
Commit 3668481f authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed saturation value in activation_forward_value()

parent 7a87db5d
No related branches found
No related tags found
2 merge requests!710.4.0,!59Continuous improvement of export_cpp
......@@ -48,9 +48,5 @@ Output_T activation_forward_value (Sum_T weightedSum,
break;
}
// Value fixed here for now but it should be generated by
// the export module or determined by the type of Output_T
// For now only works for int8_t and uint8_t
const uint32_t NB_BITS = 8;
return saturate<Output_T>(rescaling(weightedSum, output), NB_BITS);
return saturate<Output_T>(rescaling(weightedSum, output), 8 * sizeof(Output_T));
}
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