美文网首页
TensorFlow学习笔记(3)tf.reduce_max,求

TensorFlow学习笔记(3)tf.reduce_max,求

作者: 谢昆明 | 来源:发表于2018-11-09 09:18 被阅读73次

用例对应的源代码,觉得有帮助可以Star

import tensorflow as tf
import numpy as np


#  Computes the maximum of elements across dimensions of a tensor. (deprecated arguments)
#
#  tf.reduce_max(
#      input_tensor,
#      axis=None,
#      keepdims=None,
#      name=None,
#      reduction_indices=None,
#      keep_dims=None
#      )

c = np.array([[3.,4], [5.,6], [6.,7]])

step = tf.reduce_max(c, 1)                                                                                  
with tf.Session() as sess:
    print(sess.run(step))

输出

[4. 6. 7.]

相关文章

网友评论

      本文标题:TensorFlow学习笔记(3)tf.reduce_max,求

      本文链接:https://www.haomeiwen.com/subject/wodnxqtx.html