I am wondering how should we concatenate tensor with different shapes in the torch. I tried torch.cat for that, but I got type erorr as follow:
print(tensor_1.shape)
print(tensor_2.shape)

new_tensor = torch.cat((tensor_1, tensor_2),1)

but I got the following error:
shape of tensor_1 (?, 30, 30, 128)
shape of tensor_2 (?, 26, 26, 128)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-20-492132d221f7> in <module>()
      6 print("shape of tensor_1", tensor_1.shape)
      7 print("shape of tensor_2", tensor_2.shape)
----> 8 torch.cat((tensor_1, tensor_2),1)

TypeError: expected Tensor as element 0 in argument 0, but got Tensor

I think in Conv1D, concatenation is simple, in Conv2D, it is not known to me how to make concatenation. Does anyone know how to do this in torch? any idea?
I was thinking getting concatenated tensor shape as (56,56,128) is not a good idea or wrong in math. Is there any workaround to do concatenation on those? any thoughts?
desired output
I am not sure how multiple tensor can be concatenated, so I am okay with output as tensor with shape of  (W, H, C). How should we do this in torch? any idea?