if I wanna do simple convolution i can use conv2d.
I want to simply compute the edge of my input (the input has the size of  BxCxDxD), and my edge kernel has the size of 3x3, how should i expand my edge kernel so when i do conv2d(Input, Kernel) the output has the same size of BxCxDxD
e.g.

import torch
import torch.nn.functional as F
K =  torch.Tensor([[1 ,0, -1],[2, 0 ,-2], [1, 0 ,-1]])
Input = torch.rand(4,3,10,10) 


output = F.conv2d(Input,K,padding=(1, 1))
output.size() # expected to be 4x3x10x10