Ceil_mode=True changes the padding.
In the case of ceil mode, additional columns and rows are added at the right as well as at the down. (Not top and not left). It does not need to be one extra column. It depends on the stride value as well. I just wrote small code snippet where you can check how the populated values are pooled in either modes.
Before I found the post referenced above, I experimented the same way with your problem, it also seems as though the zero-padding is not used during the pooling operation, as in my following example the zeros would have been the maximum elements to be taken, but this does not seem to be the case.
test_tensor = torch.FloatTensor(2,7,7).random_(-10,-5)
print(test_tensor)
max_pool = nn.MaxPool2d(kernel_size=2, stride=2, ceil_mode=True)
print(max_pool(test_tensor))
max_pool = nn.MaxPool2d(kernel_size=2, stride=2, ceil_mode=False)
print(max_pool(test_tensor))
Random sample tensor:
tensor([[[ -6., -9., -7., -10., -6., -8., -6.],
[-10., -10., -10., -6., -10., -9., -6.],
[-10., -7., -7., -8., -10., -10., -9.],
[ -8., -10., -10., -9., -9., -10., -9.],
[ -8., -6., -8., -6., -7., -7., -9.],
[-10., -8., -7., -10., -9., -6., -8.],
[-10., -6., -9., -10., -9., -9., -10.]],
[[-10., -8., -6., -10., -9., -6., -7.],
[ -7., -7., -10., -10., -6., -9., -7.],
[ -6., -10., -7., -8., -8., -10., -9.],
[ -8., -8., -6., -7., -6., -8., -6.],
[ -9., -8., -7., -10., -8., -8., -7.],
[-10., -10., -6., -9., -8., -8., -8.],
[-10., -6., -9., -9., -7., -9., -10.]]])
ceil_mode=True
tensor([[[ -6., -6., -6., -6.],
[ -7., -7., -9., -9.],
[ -6., -6., -6., -8.],
[ -6., -9., -9., -10.]],
[[ -7., -6., -6., -7.],
[ -6., -6., -6., -6.],
[ -8., -6., -8., -7.],
[ -6., -9., -7., -10.]]])
ceil_mode=False
tensor([[[-6., -6., -6.],
[-7., -7., -9.],
[-6., -6., -6.]],
[[-7., -6., -6.],
[-6., -6., -6.],
[-8., -6., -8.]]])