What does output_padding exactly do in ConvTranspose2d?

In doc:
output_padding (int or tuple, optional): Zero-padding added to one side of the output.
But I don’t really understand what this means.
Can some explain this with some examples?

think of ConvTranspose as the opposite operation of Conv and output_padding of ConvTranspose is input padding of Conv

2 Likes

I’m curious: if output_padding of ConvTranspose is input padding of Conv, why is it single-sided?

I.e.,

# input padding = 1 in Conv:
[[ 0 0 0 ]
 [ 0 1 0 ]
 [ 0 0 0 ]]

# but output padding = 1 in ConvTransposed:
[[ 1 0 ]
 [ 0 0 ]]
1 Like

output padding is assymmetric. it’s only applied in the right and the bottom of the image.

3 Likes