Thanks It worked for me .just to add: put below code in train function and evaluate fubction
Set initial decoder hidden state to the encoder’s final hidden state
#Get the encoder final h_hidden_state
encoder_h_hidden, encoder_c_hidden= encoder_hidden
decoder_h_hidden = encoder_h_hidden[:decoder.n_layers]
decoder_c_hidden = encoder_c_hidden[:decoder.n_layers]
Recombine the final hidden states as hidden tuple
decoder_hidden = (decoder_h_hidden, decoder_c_hidden)