x = tf.constant([[0.3776],
[0.3031],
[0.4818],
[0.3887]])
y=tf.reduce_mean(x) # 1.5
tf.reduce_mean(x, 0) # [1.5, 1.5]
tf.reduce_mean(x, 1) # [1., 2.]
with tf.Session() as sess:
print(sess.run(y))
torch.mean和tf.reduce_mean
最新推荐文章于 2025-05-23 09:16:47 发布