# tf.compat.v1.add_to_collection

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/framework/ops.py#L6080-L6097) |

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

    tf.compat.v1.add_to_collection(
        name, value
    )

See [`tf.Graph.add_to_collection`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/Graph#add_to_collection)
for more details.

<br />

<br />

<br />

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

<br />

<br />

## eager compatibility

<br />

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

<br />

<br />