Description: I want to aplply the same convolution over the concatenation of every channel in tensor A (mxhxw) and the whole tensor B(nxhxw).

Let’s say, we have two tensors A (mxhxw) and B (nxhxw). Now I want to do the following operations (convolutions, batch dimension removed):

*for k in range (0, m):*

*Concat kth channel in tensor A with the whole tensor B, then we have a new tensor C_k of size (1+n, , h, w), then apply a convolution layer on C_k (in_channel=n+1, out_channel=p, kernel =3, stride=1). Ideally we have an output of size (p, h, w).*

**Note: apply the same concolution for every C_k (sharing weights).**

The final output would be a new tensor of size (mxp, ,h, w).

Is there a smart way to do this? Thanks a lot !