返回張量軸上具有最小值的索引。
用法
tf.math.argmin(
input, axis=None, output_type=tf.dtypes.int64, name=None
)參數
-
input一個Tensor。必須是以下類型之一:float32,float64,int32,uint8,int16,int8,complex64,int64,qint8,quint8,qint32,bfloat16,uint16,complex128,half,uint32,uint64。 -
axis一個Tensor。必須是以下類型之一:int32,int64。 int32 或 int64,必須在-rank(input), rank(input))範圍內。說明要減少輸入張量的哪個軸。對於向量,使用axis = 0。 -
output_type一個可選的tf.DType來自:tf.int32, tf.int64。默認為tf.int64。 -
name操作的名稱(可選)。
返回
-
Tensor類型為output_type。
在平局的情況下返回最小索引。
用法:
import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.math.argmin(input = a)
c = tf.keras.backend.eval(b)
# c = 0
# here a[0] = 1 which is the smallest element of a across axis 0
相關用法
- Python tf.math.argmax用法及代碼示例
- Python tf.math.acosh用法及代碼示例
- Python tf.math.accumulate_n用法及代碼示例
- Python tf.math.angle用法及代碼示例
- Python tf.math.add_n用法及代碼示例
- Python tf.math.acos用法及代碼示例
- Python tf.math.atan用法及代碼示例
- Python tf.math.add用法及代碼示例
- Python tf.math.asin用法及代碼示例
- Python tf.math.asinh用法及代碼示例
- Python tf.math.abs用法及代碼示例
- Python tf.math.atan2用法及代碼示例
- Python tf.math.atanh用法及代碼示例
- Python tf.math.special.fresnel_cos用法及代碼示例
- Python tf.math.polyval用法及代碼示例
- Python tf.math.is_finite用法及代碼示例
- Python tf.math.special.bessel_k0e用法及代碼示例
- Python tf.math.invert_permutation用法及代碼示例
- Python tf.math.segment_prod用法及代碼示例
- Python tf.math.bincount用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.math.argmin。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
