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?