Well indeed if you use maxpool you need much more padding. There is a pytorch pad function which you can apply after each maxpool if that’s what you really want. Anyway I don’t find why would you like to maxpool if you want to preserve the shape. You may want to use dilated convolutions instead.