小编roh*_*hin的帖子

张量流:reduce_max函数

考虑以下代码-

a=tf.convert_to_tensor(np.array([[1001,1002],[3,4]]), dtype=tf.float32)
b=tf.reduce_max(a,reduction_indices=[1], keep_dims=True)
with tf.Session():
   print b.eval()
Run Code Online (Sandbox Code Playgroud)

keep_dims的目的到底是什么?我进行了相当多的测试,发现以上内容等同于-

b=tf.reduce_max(a,reduction_indices=[1], keep_dims=False)
b=tf.expand_dims(b,1)
Run Code Online (Sandbox Code Playgroud)

我可能错了,但我的猜测是,如果keep_dims为False,我们将获得2D列向量。如果keep_dims = True,我们有一个2x1矩阵。但是它们有什么不同?

matrix deep-learning tensorflow

1
推荐指数
1
解决办法
2369
查看次数

标签 统计

deep-learning ×1

matrix ×1

tensorflow ×1