deJQK:

Unfortunately, unfold do not support dilation.


What is the issue you are seeing?
inp = torch.randn(1, 3, 10, 12)
w = torch.randn(2, 3, 4, 5)
inp_unf = torch.nn.functional.unfold(inp, (4, 5), dilation=(2,2))
out_unf = inp_unf.transpose(1, 2).matmul(w.view(w.size(0), -1).t()).transpose(1, 2)
out = torch.nn.functional.fold(out_unf, (4, 4), (1, 1))
(torch.nn.functional.conv2d(inp, w, dilation=(2,2)) - out).abs().max().item()

seems to work for me.
Best regards
Thomas