They are not pre-trained and are my own architecture. I want to have flexible architecture.
Adding linear layer is the solution, but I don’t know how reshape the tesnors of encoder output to fit the decoder input, for example if encoder hidden output have shape (enc_num_layer, batch_size, enc_hidden_size) and decoder hidden input have shape (dec_num_layer, batch_size, dec_hidden_size) and enc_num_layer * enc_hidden_size = dec_num_layer * dec_hidden_size, how should I prepare input for linear layer? I used view method, but it change element orders.