Solved by albanD in post #2 
              
              
                Hi, 
The max pooling layer uses the maximum value out of all the ones in the kernel. So the gradient is 1 for the selected value and 0 for all the others. 
So during the backward, the gradient of the output is (multiplied by 1 and) set to the selected value. All the others are set to 0. 
To do so, i…