tf.reduce_sum(inputs, axis=0) - This performe the same mathematical
operation, but tf.add_n may be more efficient because it sums the
tensors directly. reduce_sum on the other hand calls
tf.convert_to_tensor on the list of tensors, unncessairly stacking them
into a single tensor before summing.
tf.add_n - This is another python wrapper for the same Op. It has
nearly identical functionality.
Args
inputs
A list of Tensor objects, each with same shape and type.
shape
Expected shape of elements of inputs (optional). Also controls the
output shape of this op, which may affect type inference in other ops. A
value of None means "infer the input shape from the shapes in inputs".
tensor_dtype
Expected data type of inputs (optional). A value of None
means "infer the input dtype from inputs[0]".
name
A name for the operation (optional).
Returns
A Tensor of same shape and type as the elements of inputs.
Raises
ValueError
If inputs don't all have same shape and dtype or the shape
cannot be inferred.