Hi Taha,
so is it correct to say at training time you did this?
encoder = EncoderRNN(n_words, hidden_size, n_layers)

outputs, hidden = encoder(input_batches, input_lengths, hidden=encoder.hidden0)

Also, how did you make the initla hidden state work for different batch sizes?
hidden0 = torch.zeros(n_layers, 1, hidden_size)
Thank you!