【tensorflow】tf-argmax()
import tensorflow as tf
input = [1, 3, 5, 7]
output = ([[1, 2],[3, 5]])
a = tf.argmax(input, 0) # 0表是按行
b = tf.argmax(output, 1) # 1 表示按列
with tf.Session() as sess:
print("输出input最大值的索引下标:", sess.run(a))
print("输出output最大值的索引下标,这是一个二维数组:",sess.run(b))
#rerurn:
3
[1 1]
本文来自博客园,作者:jucw,转载请注明原文链接:https://www.cnblogs.com/Jucw/p/16216573.html