torch.nn.utils.rnn.pad_packed_sequence — PyTorch 1.11.0 ...
pytorch.org › docs › stabletorch.nn.utils.rnn.pad_packed_sequence(sequence, batch_first=False, padding_value=0.0, total_length=None) [source] Pads a packed batch of variable length sequences. It is an inverse operation to pack_padded_sequence (). The returned Tensor’s data will be of size T x B x *, where T is the length of the longest sequence and B is the batch size.
PackedSequence — PyTorch 1.11.0 documentation
pytorch.org › docs › stableBatch sizes represent the number elements at each sequence step in the batch, not the varying sequence lengths passed to pack_padded_sequence (). For instance, given data abc and x the PackedSequence would contain data axbc with batch_sizes= [2,1,1]. Variables. ~PackedSequence.data ( Tensor) – Tensor containing packed sequence.