Split a PackedSequence into its variable-length sequences.
The inverse of pack_sequence: the sequences come back in the
order they were packed in, whether or not they were sorted.
Parameters
packed_ sequencesPackedSequencePacked batch to split.
Returns
list of TensorOne tensor per sequence, the b-th of shape (length_b, *).
Raises
ValueErrorAs
pad_packed_sequence, for a malformed batch_sizes or
unsorted_indices.Examples
>>> import lucid
>>> from lucid.nn.utils.rnn import pack_sequence, unpack_sequence
>>> packed = pack_sequence([lucid.ones(2, 3), lucid.ones(4, 3)], enforce_sorted=False)
>>> [s.shape for s in unpack_sequence(packed)]
[(2, 3), (4, 3)]