torch.nn.utils.rnn.pack_sequence
- torch.nn.utils.rnn.pack_sequence(sequences, enforce_sorted=True)
Packs a list of variable length Tensors.
Consecutive call of the next functions:
pad_sequence,pack_padded_sequence.sequencesshould be a list of Tensors of size , where is the length of a sequence and is any number of trailing dimensions, including .