Adding to the above code - how would this generalize for variable sequence lengths ? Ie if the batch size was 1 and sequence length is varying as given in the pytorch tutorial http://pytorch.org/tutorials/beginner/nlp/sequence_models_tutorial.html#sphx-glr-beginner-nlp-sequence-models-tutorial-py 120
Here the sequence length of train data is 5 and 4 for the two sentences