How to compute output shape when ceil_model =True at pooling layer


I don’t know how to computer the output shape when ceil_model=True in MaxPool2d.

class torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)

Thank you in advance!

The docs say the output shape is calculated with the following formula…


So for ceil_mode just replace floor with ceil in the above calculation.

Besides you probably don’t want to be looking at the docs for the development version of pytorch.
The link for the docs for pytorch 0.3.1 is