TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.nn.utils.rnn.invert_permutation

tensorplay.nn.utils.rnn.invert_permutation(permutation: Tensor | None) → Tensor | None[source]

Returns the inverse of permutation.

This is useful for converting between sorted and unsorted indices in a PackedSequence.

Parameters:

permutation (Tensor, optional) – a 1-D tensor of indices to invert

On this page

Ask DeepWiki