| View source on GitHub | 
Adds all input tensors element-wise.
tf.math.add_n(
    inputs, name=None
)
  tf.math.add_n performs the same operation as tf.math.accumulate_n.
This op does not broadcast its inputs. If you need broadcasting, use tf.math.add (or the + operator) instead.
a = tf.constant([[3, 5], [4, 8]])
b = tf.constant([[1, 6], [2, 9]])
tf.math.add_n([a, b, a])
<tf.Tensor: shape=(2, 2), dtype=int32, numpy=
array([[ 7, 16],
       [10, 25]], dtype=int32)>
  
| Args | |
|---|---|
| inputs | A list of tf.Tensorortf.IndexedSlicesobjects, each with the same shape and type.tf.IndexedSlicesobjects will be converted into dense tensors prior to adding. | 
| name | A name for the operation (optional). | 
| Returns | |
|---|---|
| A tf.Tensorof the same shape and type as the elements ofinputs. | 
| Raises | |
|---|---|
| ValueError | If inputsdon't all have same shape and dtype or the shape cannot be inferred. | 
    © 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
    https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/math/add_n