First I have a feature map, then I used nn.Conv2d(in_channel, out_channel, 3, stride=2, padding=1, bias=True) to generate a intermediary feature map. Next, fed it to nn.ConvTranspose2d(conv_channels, conv_channels, 3, stride=2, padding=1, output_padding=1) and get the final output.
My question is how to control the parameters padding and output_padding in order to get the same size final output with the initial feature map. When I used padding=1 and output_padding=1, It only worked as the initial feature map had even number size. While I used  feature map with odd number size, It’s wrong.
Could anyone help me please?
Thanks~