Skip to content
Snippets Groups Projects
Commit fa9d9ded authored by Gallas Gaye's avatar Gallas Gaye
Browse files

fixed warning in pooling

parent 760ea454
No related branches found
No related tags found
No related merge requests found
Pipeline #69606 failed
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stdexcept> #include <stdexcept>
template<int NB_CHANNELS, template<int NB_CHANNELS,
int CHANNELS_HEIGHT, int CHANNELS_WIDTH, int CHANNELS_HEIGHT, int CHANNELS_WIDTH,
int NB_OUTPUTS, int NB_OUTPUTS,
int OUTPUTS_HEIGHT, int OUTPUTS_WIDTH, int OUTPUTS_HEIGHT, int OUTPUTS_WIDTH,
...@@ -17,7 +17,7 @@ template<int NB_CHANNELS, ...@@ -17,7 +17,7 @@ template<int NB_CHANNELS,
Pooling_T POOLING_TYPE, Pooling_T POOLING_TYPE,
ActivationFunction_T ACTIVATION, ActivationFunction_T ACTIVATION,
typename Input_T, typename Output_T> typename Input_T, typename Output_T>
__attribute__((always_inline)) inline __attribute__((always_inline)) inline
void pooling_forward( void pooling_forward(
const Input_T* __restrict inputs, const Input_T* __restrict inputs,
Output_T* __restrict outputs) Output_T* __restrict outputs)
...@@ -32,7 +32,7 @@ void pooling_forward( ...@@ -32,7 +32,7 @@ void pooling_forward(
: max(PADDING_Y - (oy * STRIDE_Y), 0); : max(PADDING_Y - (oy * STRIDE_Y), 0);
const int syMax = (PADDING_Y == 0 const int syMax = (PADDING_Y == 0
&& OUTPUTS_HEIGHT == OUTPUTS_HEIGHT_NOPAD) ? POOL_HEIGHT && OUTPUTS_HEIGHT == OUTPUTS_HEIGHT_NOPAD) ? POOL_HEIGHT
: clamp(CHANNELS_HEIGHT + PADDING_Y - (oy * STRIDE_Y), : clamp(CHANNELS_HEIGHT + PADDING_Y - (oy * STRIDE_Y),
0, POOL_HEIGHT); 0, POOL_HEIGHT);
const int iy = (oy * STRIDE_Y) - PADDING_Y; const int iy = (oy * STRIDE_Y) - PADDING_Y;
...@@ -45,7 +45,7 @@ void pooling_forward( ...@@ -45,7 +45,7 @@ void pooling_forward(
const int sxMax = (PADDING_X == 0 const int sxMax = (PADDING_X == 0
&& OUTPUTS_WIDTH == OUTPUTS_WIDTH_NOPAD) && OUTPUTS_WIDTH == OUTPUTS_WIDTH_NOPAD)
? POOL_WIDTH ? POOL_WIDTH
: clamp(CHANNELS_WIDTH + PADDING_X - (ox * STRIDE_X), : clamp(CHANNELS_WIDTH + PADDING_X - (ox * STRIDE_X),
0, POOL_WIDTH); 0, POOL_WIDTH);
const int ix = (ox * STRIDE_X) - PADDING_X; const int ix = (ox * STRIDE_X) - PADDING_X;
...@@ -86,7 +86,7 @@ void pooling_forward( ...@@ -86,7 +86,7 @@ void pooling_forward(
outputs[oOffset + output] = maxVal; outputs[oOffset + output] = maxVal;
} }
else if (POOLING_TYPE == Average) { else if (POOLING_TYPE == Average) {
int32_t sum = 0; outputs[oOffset + output] = 0;
for (int sy = 0; sy < POOL_HEIGHT; ++sy) { for (int sy = 0; sy < POOL_HEIGHT; ++sy) {
if ((PADDING_Y != 0 if ((PADDING_Y != 0
......
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