Aside from the forward pass modification mentioned above, I believe it is also necessary to change the part of the code in the training function. I.e, instead of passing the last encoder_hidden, make sure you are also passing the last (encoder_ h_hidden, encoder_c_hidden) to the decoder.