Quentin_Munch:

input_hidden = self.hidden(torch.cat((out_encoder, last_H, last_H_superior), 3)) # ???


In this line, itseems you are expecting 4D inputs?
Linear layer works with 2D inputs (batch_size x input_dim).