Based on 'https://github.com/Oldpan/faceswap-pytorch/blob/master/padding_same_conv.py'.
I added some tensorflow type padding in pytorch Conv2d.
For more specific, you can use padding='SAME' and padding='VALID' with my code.
You can also use it as normal conv2d in pytorch.
Great thanks to @Oldpan in 'https://github.com/Oldpan/faceswap-pytorch' and https://oldpan.me/archives/pytorch-same-padding-tflike for his great work!!