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?
Yes, this would be one way to go. You would need to set the unwanted weights to zero and the gradient as well if that’s your use case.
Here is a small code sample:
Thank you very much for your reply. I also wonder if there is other way to do that?
I found another similar question: Custom convolution shape
and you said ‘Tensor Comprehensions’ is another way. Do you think if it’s easier to go with TC?