Usage of pack_sequence

The usage for pack sequence here seems simple enough. Sort the tensors by their length then feed it to the function. However, I needed to ask if there are any additional steps that I must be aware of when using pack_sequence to train my RNN on a dataset whose sequences have varying length. I looked through the forums but can’t find a definitive answer.

        >>> from torch.nn.utils.rnn import pack_sequence
        >>> a = torch.tensor([1,2,3])
        >>> b = torch.tensor([4,5])
        >>> c = torch.tensor([6])
        >>> pack_sequence([a, b, c])
        PackedSequence(data=tensor([ 1,  4,  6,  2,  5,  3]), batch_sizes=tensor([ 3,  2,  1]))

if there length vary the padding sequence will pad it to have the same size of the input.
for instance when are dealing with seq-seq model where u decode and encode the data to pad the data like a language translation model