W1A2: Output size for tfl.MaxPooling2D with argument: padding='same'

In the Week-1 assignment-2 (W1A2; Convolution Model Application), when we’re constructing the function ‘convolution_model’ with the help of Functional API. It is instructed to apply tfl.MaxPooling2D layer with padding=‘same’. This confuses me as the documentation says that for value of padding as “same”, the output has the same width/height as the input. So, when we’re using a stride of 8, I’m expecting the output height/width to be 1/8 the size of the input height/width, which is also the case as we see in the output of notebook cell. So, what’s the point of passing padding=‘same’, if the output size will not be same as the input size?

Same padding ensures the output will padded with cells so the resulting shape is the same as the input, no matter what the convolution reduction in shape is!

It turns out that “same” padding only produces the same output size when stride = 1. For larger values of stride, the output size is not the same. Here’s a thread which discusses this in more detail.