求和平均
import tensorflow as tf
x=[1,3]
y=tf.square(x)
z=tf.reduce_mean(y)
with tf.Session() as sess:
print(sess.run(y))
print(sess.run(z))
结果:
[1 9]
5
求和平均
import tensorflow as tf
x=[1,3]
y=tf.square(x)
z=tf.reduce_mean(y)
with tf.Session() as sess:
print(sess.run(y))
print(sess.run(z))
结果:
[1 9]
5