Thank you! You are so kind!
My problem is a little hard to understand so I will try my best to express it. Hope you could understand this.
So the convolution I would like to perform is in conv2d case.
Instead of changing the shape of the kernel so many times, I would like to keep the process of conv2d the same about kernel shape (3x3) and the way natural conv2d should perform in learning,etc.
The thing I want to do can be said in this way:
First, In the normal way of 2d convolution, the multiplication between the kernel and the input should be in  this way:

But now, for every small 3x3 part of the input, I will only keep the center pixel. The surrounding pixel of the 3x3 part of the input will be replaced by the corresponding pixels in other positions on the input(which I already knew). The example of the surrounding pixels’ positions is just like on the picture of the first question:



 Chuong_Vo:


Positions1680×420 14.7 KB


These new pixels and the center pixel will come together and form a new 3x3 matrix that will be used to multiply with the kernel in a normal way. So I technically only interfere the first step of 2D convolution.
Is there anyway of implementing that? Thank you!