# tf.contrib.losses.get_total_loss

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/losses/python/losses/loss_ops.py#L216-L236) |

Returns a tensor whose value represents the total loss. (deprecated)

    tf.contrib.losses.get_total_loss(
        add_regularization_losses=True, name='total_loss'
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed after 2016-12-30. Instructions for updating: Use tf.losses.get_total_loss instead.

Notice that the function adds the given losses to the regularization losses.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `add_regularization_losses` | A boolean indicating whether or not to use the regularization losses in the sum. |
| `name` | The name of the returned tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` whose value represents the total loss. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if `losses` is not iterable. |

<br />