I am using following code in model ,
nn.Conv2d(1,16, kernel_size=5, stride=1),
I want my output to be of same size as input ie (40,1,128,186)
I tried using
But getting (40, 16, 128, 182)
Can anyone help plz.
From what I know, Pytorch doesn’t support this as an inbuilt option, TensorFlow does. Checkout this discussion which mentions how dynamic loading makes it hard.
However, there could be ways to hack it by combining asymmtric padding layers with conv2d layers. I wouldn’t bother doing it, unless super useful and just go with the inbuilt padding options. More discussion here.