Most likely it is related to different ‘same’ padding behavior in TF and Pytorch. It is symmetric in Pytorch and asymmetric in TF. I also faced this issue and solved it by adding manual padding in symmetric manner before convolution using tf.pad. In conv layer padding should be ‘valid’ after that.