tf.arg_max

tf.arg_max ,返回最大值的索引

import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.math.argmax(input = a)
c = tf.keras.backend.eval(b)
# c = 4
# here a[4] = 166.32 which is the largest element of a across axis 0
posted @ 2022-08-19 22:51  luoganttcc  阅读(6)  评论(0)    收藏  举报