I’m sorry, I can’t post the model definition, unfortunately (my company policies). I used padding default which is same, but I also defined my padding=1 in everywhere which is the equivalent of the Keras model I wrote. As far as I know, Keras is padding with the required amount of zeros for the filter, yet this is also equivalent to apply convolution on a bunch of zeros. Therefore, I updated the model parameters as Pytorch asks. So, problem solved. Thanks anyway.