Reduces input_tensor along the dimensions given in axis.
Unless keepdims is true, the rank of the tensor is reduced by 1 for each
entry in axis. If keepdims is true, the reduced dimensions
are retained with length 1.
If axis is None, all dimensions are reduced, and a
tensor with a single element is returned.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.math.reduce_sum\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/math/reduce_sum) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/math_ops.py#L1462-L1516) |\n\nComputes the sum of elements across dimensions of a tensor. (deprecated arguments)\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.reduce_sum`](/api_docs/python/tf/math/reduce_sum)\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.math.reduce_sum`](/api_docs/python/tf/compat/v1/reduce_sum), [`tf.compat.v1.reduce_sum`](/api_docs/python/tf/compat/v1/reduce_sum)\n\n\u003cbr /\u003e\n\n tf.math.reduce_sum(\n input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,\n keep_dims=None\n )\n\n| **Warning:** SOME ARGUMENTS ARE DEPRECATED: `(keep_dims)`. They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead\n\nReduces `input_tensor` along the dimensions given in `axis`.\nUnless `keepdims` is true, the rank of the tensor is reduced by 1 for each\nentry in `axis`. If `keepdims` is true, the reduced dimensions\nare retained with length 1.\n\nIf `axis` is None, all dimensions are reduced, and a\ntensor with a single element is returned.\n\n#### For example:\n\n x = tf.constant([[1, 1, 1], [1, 1, 1]])\n tf.reduce_sum(x) # 6\n tf.reduce_sum(x, 0) # [2, 2, 2]\n tf.reduce_sum(x, 1) # [3, 3]\n tf.reduce_sum(x, 1, keepdims=True) # [[3], [3]]\n tf.reduce_sum(x, [0, 1]) # 6\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `input_tensor` | The tensor to reduce. Should have numeric type. |\n| `axis` | The dimensions to reduce. If `None` (the default), reduces all dimensions. Must be in the range `[-rank(input_tensor), rank(input_tensor))`. |\n| `keepdims` | If true, retains reduced dimensions with length 1. |\n| `name` | A name for the operation (optional). |\n| `reduction_indices` | The old (deprecated) name for axis. |\n| `keep_dims` | Deprecated alias for `keepdims`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The reduced tensor, of the same dtype as the input_tensor. ||\n\n\u003cbr /\u003e\n\n#### Numpy Compatibility\n\nEquivalent to np.sum apart the fact that numpy upcast uint8 and int32 to\nint64 while tensorflow returns the same dtype as the input."]]