1Computes the sum of elements across dimensions of a tensor.
2
3x = tf.constant([[1, 1, 1], [1, 1, 1]])
4tf.reduce_sum(x) # 6
5tf.reduce_sum(x, 0) # [2, 2, 2]
6tf.reduce_sum(x, 1) # [3, 3]
7tf.reduce_sum(x, 1, keepdims=True) # [[3], [3]]
8tf.reduce_sum(x, [0, 1]) # 6