import tensorflow as tf
x = tf.constant([[1,2,3],[2,2,3]])
print("x:",x)
print("mean of x:",tf.reduce_mean(x)) #对所有数值求均值
print("sum of x:",tf.reduce_sum(x,axis=1)) #分别对1,2,3与2,2,3求和
"""
x: tf.Tensor(
[[1 2 3]
[2 2 3]], shape=(2, 3), dtype=int32)
mean of x: tf.Tensor(2, shape=(), dtype=int32)
sum of x: tf.Tensor([6 7], shape=(2,), dtype=int32)
"""