# tf.contrib.losses.add_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#L176-L186) |

Adds a externally defined loss to the collection of losses. (deprecated)

    tf.contrib.losses.add_loss(
        loss, loss_collection=tf.GraphKeys.LOSSES
    )

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

<br />

<br />

<br />

| ## Args ||
|---|---|
| `loss` | A loss `Tensor`. |
| `loss_collection` | Optional collection to add the loss to. |

<br />