Solved by Nikronic in post #2 
              
              
                Hi, 
PyTorch does not support same padding explicitly, but you can obviously find the proper padding size p using the exact same formula you have provided. In your case, something especial is that padding size cannot be an integer number which means you have to have one side more padded. 
(2*(output…