diff options
Diffstat (limited to 'tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.invert_permutation.md')
-rw-r--r-- | tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.invert_permutation.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.invert_permutation.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.invert_permutation.md new file mode 100644 index 0000000000..b12cc7e94c --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.invert_permutation.md @@ -0,0 +1,30 @@ +### `tf.invert_permutation(x, name=None)` {#invert_permutation} + +Computes the inverse permutation of a tensor. + +This operation computes the inverse of an index permutation. It takes a 1-D +integer tensor `x`, which represents the indices of a zero-based array, and +swaps each value with its index position. In other words, for an output tensor +`y` and an input tensor `x`, this operation computes the following: + +`y[x[i]] = i for i in [0, 1, ..., len(x) - 1]` + +The values must include 0. There can be no duplicate values or negative values. + +For example: + +```prettyprint +# tensor `x` is [3, 4, 0, 2, 1] +invert_permutation(x) ==> [2, 4, 3, 0, 1] +``` + +##### Args: + + +* <b>`x`</b>: A `Tensor` of type `int32`. 1-D. +* <b>`name`</b>: A name for the operation (optional). + +##### Returns: + + A `Tensor` of type `int32`. 1-D. + |