Custom convolution shape

Hi PyTorchers,

I would like to implement a 2D convolution the shape of a cross.

For example, with an input (1, 1, 14, 14) where (nSamples,nChannels,H,W) the convolution would be 1x14 horizontally AND 14x1 vertically to produce an output input (1, 1, 14, 14).

Is there a facility in PyTorch for implementing irregular convolution shapes?
What is the recommended approach?


I think Tensor Comprehensions might be a good fit for your use case.
You can synthesize high-performance kernels and use them in PyTorch.

Have a look at some conv examples to get an idea, what to do.

Many thanks for the reply ptrblck.
It got me thinking.
I can implement this with 2 x 1D convolutions summing the results.