[Relay] conv2d_transpose doesn't handle output_padding correctly


The output_padding parameter just pads the topi output with zeros.

I am trying to get conv2d_transpose to work in the context of a gradient of conv2d. Because of this I get output that has the right shape, but bad values (zeros) around the edges in some cases. This happens when the forward code does striding.

I also looked at the registered gradient code for nn.conv2d and it has the same issue for the input gradient.

Maybe I am doing something wrong here, but I think that just padding with zeros is the wrong thing to do. None of the other frameworks that I checked does this.


Can you explain what is the desired behavior?
Padding with zero should be correct. For gradient, it is mainly used for non-divisible strides. In this case, we pad the conv grad with zeros