Looking at different implementations I found for tensorflow, like this one: tensorflow - How to implement a L2 pooling layer in Keras? - Stack Overflow 3 , I think you are right. I see most people implementing it like this. However, I’m not quite sure it’s the same as the L2 norm as this is described as:

The only difference in your (and other implementations I found) is the reduction by division of the number of elements (so taking the mean instead of the sum). Perhaps this reduction does not matter too much though…
Edit:
I figured out that you can use divisor_override = 1 in avgpool() so that you won’t have this issue.