計算沿張量段的最大值。
用法
tf.math.segment_max(
data, segment_ids, name=None
)參數
-
data一個Tensor。必須是以下類型之一:float32,float64,int32,uint8,int16,int8,int64,bfloat16,uint16,half,uint32,uint64。 -
segment_ids一個Tensor。必須是以下類型之一:int32、int64。一維張量,其大小等於data的第一個維度的大小。值應該排序並且可以重複。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與data相同的類型。
閱讀the section on segmentation 以了解段的解釋。
計算一個張量,使得 其中 max 超過 j 使得 segment_ids[j] == i 。
如果給定段 ID i 、 output[i] = 0 的最大值為空。
例如:
c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
tf.segment_max(c, tf.constant([0, 0, 1]))
# ==> [[4, 3, 3, 4],
# [5, 6, 7, 8]]
相關用法
- Python tf.math.segment_mean用法及代碼示例
- Python tf.math.segment_min用法及代碼示例
- Python tf.math.segment_prod用法及代碼示例
- Python tf.math.segment_sum用法及代碼示例
- Python tf.math.special.fresnel_cos用法及代碼示例
- Python tf.math.special.bessel_k0e用法及代碼示例
- Python tf.math.special.bessel_j0用法及代碼示例
- Python tf.math.scalar_mul用法及代碼示例
- Python tf.math.special.fresnel_sin用法及代碼示例
- Python tf.math.sigmoid用法及代碼示例
- Python tf.math.special.bessel_j1用法及代碼示例
- Python tf.math.sinh用法及代碼示例
- Python tf.math.sign用法及代碼示例
- Python tf.math.sin用法及代碼示例
- Python tf.math.special.bessel_y0用法及代碼示例
- Python tf.math.special.bessel_k1用法及代碼示例
- Python tf.math.softplus用法及代碼示例
- Python tf.math.special.bessel_k1e用法及代碼示例
- Python tf.math.square用法及代碼示例
- Python tf.math.subtract用法及代碼示例
- Python tf.math.special.bessel_k0用法及代碼示例
- Python tf.math.special.spence用法及代碼示例
- Python tf.math.special.dawsn用法及代碼示例
- Python tf.math.special.expint用法及代碼示例
- Python tf.math.special.bessel_y1用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.math.segment_max。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
