This is the code:
import torch
from torch.nn import Conv2d
import torch.nn.functional as F

conv = Conv2d(3,10,3,1,1)
x = torch.Tensor(torch.rand(1,3,10,10))
R1 = conv(x)
R2 = F.conv2d(x, weight=conv.weight, bias=conv.bias, stride=conv.stride, padding=conv.padding, dilation=(2, 2), groups=conv.groups)