You can use F.conv2d(F.pad(input, pad=(5,5,5,5), mode='circular'), kernel, padding=0) for circular convolution. Btw, you sometimes cannot find the mode circular for F.pad if you directly search in  the help doc, but your can go to https://pytorch.org/docs/stable/nn.functional.html?highlight=pad#torch.nn.functional.pad 121