reduce_sum
reduce_sum(value, axis=0,keepdims=False)
x = tf.constant([[1, 1, 1,], [2, 2, 2]])
当keepdims=False:
当axis=0时: [3 3 3]
当axis=1时: [3 6]
当无axis时: 9
当keepdims=True时:
当axis=0时: [[3 3 3]]
当axis=1时: [[3] [6]]
当无axis时: [[9]]
reduce_mean同上,计算平均值
argmax
x = tf.constant([[1, 2, 3,], [3, 2, 1]])
当axis=0时: [1 0 0]
当axis=1时: [2 0]
argmin同上,计算最小值对应的索引
网友评论