Thank you for your response.
I already know about F.conv2d but I wanted to use kernels not just for convolution but for CNN (nn.Conv2d) where learning of weights take place.
I don’t think F.conv2d will help.