as @JuanFMontesinos mentioned, you can create an nn.Conv2d initialized with random weights. Then, set its parameters using your own kernel.
Something like this (you can adjust the input values of each function):
from torch.nn.parameter import Parameter
...

conv2D = nn.Conv2d(in_channels, in_channels, kernel_size, stride=stride, padding=padding,
                                dilation=dilation, groups=in_channels, bias=False)  # do not use the bias.
conv2D.weight = Parameter(data=kernel2d, requires_grad=False)  # kernel2d is your own kernel.