TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.framework.reduce_sum_n

View source on GitHub

Reduce tensors to a scalar sum.

tf.contrib.framework.reduce_sum_n(
    tensors,
    name=None
)

This reduces each tensor in tensors to a scalar via tf.reduce_sum, then adds them via tf.add_n.

Args:

  • tensors: List of tensors, all of the same numeric type.
  • name: Tensor name, and scope for all other ops.

Returns:

Total loss tensor, or None if no losses have been configured.

Raises:

  • ValueError: if losses is missing or empty.