Hi @divyesh_rajpura,
Thanks for your reply! Actually, I’ve been through the tutorial and I think that I have a clear idea of what the function does. The problem is that they use the output of the function directly on a lstm (packed_output, (ht, ct) = lstm(packed_input)). In other words, the function lstm do all the work automatically for the whole sequence of words.
The problem for me, is that I need to do that myself. That is why, in my train function there is a for loop, because I need to run the rnn for each word and at the end take the hidden vector and the output. In a batch scenario, I can’t do that.
Do you have any ideas about how can I do it ??
Thank you again!