diff --git a/aidge_export_cpp/kernels/fullyconnected.hpp b/aidge_export_cpp/kernels/fullyconnected.hpp index 895ed1c21d35e7e266f788407dd7f42719607ad7..2780de2deadd9c519597627e64eb5bedeee948f8 100644 --- a/aidge_export_cpp/kernels/fullyconnected.hpp +++ b/aidge_export_cpp/kernels/fullyconnected.hpp @@ -30,7 +30,7 @@ void fullyconnected_forward ( // Solution: Add a system to check dataformat for (int och = 0; och < NB_OUTPUTS; och++) { - Bias_T weightedSum = biases[och]; + Bias_T weightedSum = (biases) ? biases[och] : Bias_T(0); for (int iy = 0; iy < CHANNELS_HEIGHT; ++iy) { for (int ix = 0; ix < CHANNELS_WIDTH; ++ix) { @@ -48,7 +48,7 @@ Here the kernel to use with inputs in NHWC and weights in NHWC #pragma omp parallel for for (int och = 0; och < NB_OUTPUTS; och++) { - Bias_T weightedSum = biases[och]; + Bias_T weightedSum = (biases) ? biases[och] : Bias_T(0); for (int iy = 0; iy < CHANNELS_HEIGHT; ++iy) { const int iPos = (CHANNELS_WIDTH * iy);