8000 docs: `torch.nn.utils.rnn.pack_padded_sequence`: docs improve (#135417) · pytorch/pytorch@b7eb725 · GitHub
[go: up one dir, main page]

Skip to content

Commit b7eb725

Browse files
kuragapytorchmergebot
authored andcommitted
docs: torch.nn.utils.rnn.pack_padded_sequence: docs improve (#135417)
docs: `torch.nn.utils.rnn.pack_padded_sequence`: docs improve /cc @mikaylagawarecki Pull Request resolved: #135417 Approved by: https://github.com/ezyang
1 parent c1ae78b commit b7eb725

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

torch/nn/utils/rnn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def pack_padded_sequence(
285285
) -> PackedSequence:
286286
r"""Packs a Tensor containing padded sequences of variable length.
287287
288-
:attr:`input` can be of size ``T x B x *`` where ``T`` is the length of the
289-
longest sequence, ``B`` is the batch size, and ``*`` is any number of dimensions
290-
(including 0). If :attr:`batch_first` is ``False``, ``T x B x *`` :attr:`input` is expected,
291-
``B x T x *`` otherwise.
288+
:attr:`input` can be of size ``T x B x *`` (if :attr:`batch_first` is ``False``)
289+
or ``B x T x *`` (if :attr:`batch_first` is ``True``) where ``T`` is the length
290+
of the longest sequence, ``B`` is the batch size, and ``*`` is any number of dimensions
291+
(including 0).
292292
293293
For unsorted sequences, use `enforce_sorted = False`. If :attr:`enforce_sorted` is
294294
``True``, the sequences should be sorted by length in a decreasing order, i.e.

0 commit comments

Comments
 (0)
0