查找最後一個維度的 n
- 階統計值的值。
用法
tf.raw_ops.NthElement(
input, n, reverse=False, name=None
)
參數
-
input
一個Tensor
。必須是以下類型之一:float32
,float64
,int32
,uint8
,int16
,int8
,int64
,bfloat16
,uint16
,half
,uint32
,uint64
。一維或更高,最後一維至少n+1
。 -
n
Tensor
類型為int32
。 0-D。要沿最後一個維度選擇的排序向量的位置(沿矩陣的每一行)。 n的有效範圍是[0, input.shape[:-1])
-
reverse
可選的bool
。默認為False
。當設置為 True 時,在向量中找到 nth-largest 值,反之亦然。 -
name
操作的名稱(可選)。
返回
-
一個
Tensor
。具有與input
相同的類型。
如果輸入是向量(rank-1),則在向量中找到nth-smallest 值的條目,並將它們的值作為標量張量輸出。
對於矩陣(分別是更高等級的輸入),計算每行中的 nth-smallest 值(分別是沿最後一維的向量)的條目。因此,
values.shape = input.shape[:-1]
相關用法
- 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用法及代碼示例
- Python tf.raw_ops.ScatterUpdate用法及代碼示例
- Python tf.raw_ops.ParallelConcat用法及代碼示例
- Python tf.raw_ops.ScatterNdUpdate用法及代碼示例
- Python tf.raw_ops.BatchToSpaceND用法及代碼示例
- Python tf.raw_ops.TensorScatterMax用法及代碼示例
- Python tf.raw_ops.DepthToSpace用法及代碼示例
- Python tf.raw_ops.MutexLock用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.NthElement。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。