# tf.add_to_collections

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/ops.py#L6171-L6186) |

Wrapper for [`Graph.add_to_collections()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph#add_to_collections) using the default graph.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.add_to_collections`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/add_to_collections)

<br />

    tf.add_to_collections(
        names, value
    )

See [`tf.Graph.add_to_collections`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph#add_to_collections)
for more details.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `names` | The key for the collections. The `GraphKeys` class contains many standard names for collections. |
| `value` | The value to add to the collections. |

<br />

#### Eager Compatibility

Collections are only supported in eager when variables are created inside
an EagerVariableStore (e.g. as part of a layer or template).