F.pad() backward pass is too slow

Hello everyone,

I’m trying to define a function that implements an operator involving a convolution.So I used the functional function F.conv2d() to implement my operator. By default, I used the zeros_padding mode and there is no problem. But when I switched into reflect or circular padding mode using the function F.pad(), the backward pass was too slow.

Does anyone have a solution with this F.pad() backward pass?
Thanks in advance!

How slow are we talking here? Could you post benchmarking results?