tf.arg_min

tf.arg_min 返回最小值的索引

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
posted @ 2022-08-19 22:51  luoganttcc  阅读(10)  评论(0)    收藏  举报