Hi Florian,
Depending on which max pool function you are using, there is a padding parameter that you can utilize – for example instantiating nn.MaxPool2d sets this padding to zero by default (MaxPool2d — PyTorch 1.8.1 documentation 1)
I believe setting that parameter to a value of one would do the trick