invert_permutation#

ivy.invert_permutation(x, /)[source]#

Compute the inverse of an index permutation.

Parameters:

x (Union[Array, NativeArray, list, tuple]) – 1-D integer array-like, which represents indices of a zero-based array and is supposedly used to permute the array.

Return type:

Array

Returns:

ret – the inverse of the index permutation represented by ‘’x’’

Examples

>>> a = ivy.asarray([0, 3, 1, 2])
>>> ivy.invert_permutation(a)
ivy.array([0, 2, 3, 1])
Container.invert_permutation(self, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)[source]#

ivy.Container instance method variant of ivy.invert_permutation.

This method simply wraps the function, and so the docstring for ivy.invert_permutation also applies to this method with minimal changes.

Return type:

Container