計算張量的逆排列。
用法
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。