计算张量的逆排列。
用法
tf.raw_ops.InvertPermutation(
x, name=None
)
参数
-
x
一个Tensor
。必须是以下类型之一:int32
,int64
。一维。 -
name
操作的名称(可选)。
返回
-
一个
Tensor
。具有与x
相同的类型。
此操作计算索引排列的逆。它采用一维整数张量 x
,它表示从零开始的数组的索引,并将每个值与其索引位置交换。换句话说,对于输出张量 y
和输入张量 x
,此操作计算以下内容:
y[x[i]] = i for i in [0, 1, ..., len(x) - 1]
值必须包含 0。不能有重复值或负值。
例如:
# tensor `x` is [3, 4, 0, 2, 1]
invert_permutation(x) ==> [2, 4, 3, 0, 1]
相关用法
- Python tf.raw_ops.Invert用法及代码示例
- Python tf.raw_ops.InplaceAdd用法及代码示例
- Python tf.raw_ops.IsInf用法及代码示例
- Python tf.raw_ops.IsNan用法及代码示例
- Python tf.raw_ops.IdentityN用法及代码示例
- Python tf.raw_ops.IsFinite用法及代码示例
- Python tf.raw_ops.Imag用法及代码示例
- Python tf.raw_ops.TPUReplicatedInput用法及代码示例
- Python tf.raw_ops.Bitcast用法及代码示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代码示例
- Python tf.raw_ops.BatchMatMul用法及代码示例
- Python tf.raw_ops.OneHot用法及代码示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代码示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代码示例
- Python tf.raw_ops.GatherV2用法及代码示例
- Python tf.raw_ops.Expm1用法及代码示例
- Python tf.raw_ops.BitwiseAnd用法及代码示例
- Python tf.raw_ops.UniqueWithCounts用法及代码示例
- Python tf.raw_ops.DecodeGif用法及代码示例
- Python tf.raw_ops.Size用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.InvertPermutation。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。