I don’t think that’s what output_padding does. It prevents some number of elements from being treated as padding (and thus removed from the output).
Consider this transpose operation:
torch.nn.Conv1d(1, 1, kernel_size=30, stride=15, padding=8, output_padding=1)

The equivalent of the above operation without specifying padding or output_padding is:
padding = 8
output_padding = 1
y = torch.nn.Conv1d(1, 1, kernel_size=30, stride=15)(x)
y[:, :, padding:-(padding - output_padding)]

The issue is that output_padding is applied to the right side, and I can’t find a way to apply it on the left instead. A natural solution would be to accept a tuple for padding, just like np.pad or any of the other PyTorch padding ops that take separate left and right padding values. That approach would be more consistent, more flexible, and eliminate output_padding entirely.
Admittedly, I could just manually extract the parts of the tensor I need and ignore padding / output_padding entirely, but I’m hoping that I just missed something and that there’s a better way to get the result I’m looking for.
(BTW, this post was motivated by the fact that TensorFlow applies the equivalent of output_padding on the left whereas PyTorch applies it on the right. This difference prevents model conversion between TF and PyTorch.)