Maybe it’s clearer with a the most basic example of predicting a target (e.g., translating “stopp” (German) to “stop”). In this case your target_tensor = ['stop', '<EOS>'] and target_length = 2. So this gives you two iterations:


decoder_hidden_1 + <SOS> ==> decoder_hidden_2 + "stop"


decoder_hidden_2 + "stop" ==> decoder_hidden_3 + <EOS>


Assuming the all predictions are correct or teacher_forcing = True. I thing the number or iterations work out just fine. Where do you think it fails w.r.t. to this example?