Hi,



 Lanorius94:

out = torch.cat((out, x[1]), 0) #here lies the problem


Your input will be something like this for concatenation:
x = [torch.randn(1, 32), torch.randn(1, 196)]

So based on this line, I expect the desired out is [1, 196+32].



 Lanorius94:

nn.Linear(hidden_size_prot+input_size_comp, hidden_size_all)


Based on this, you need to concatenate in second dimension not first. First one is for batch size.
So, this will solve this issue:
out = torch.cat((out, x[1]), dim=1)  # note that dim=1 -> [batch_size, 196], [batch_size, 32]

Bests