Hi,
I’d like to set the shape of my convolution kernel to a circle instead of a NN square. My idea is to make the corners of NN kernel unchanged (to be zero). Do you guys know if there is a way to do that in PyTorch?

IMG_2271.JPG3024×4032 1.6 MB

I’m not sure whether setting the ‘weight’ in ‘torch.functional.conv2d(input,weight,…)’ is a way to do that.
Thank you