# tf.contrib.eager.EagerVariableStore

<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/ops/variable_scope.py#L1387-L1461) |

Wrapper allowing functional layers to be used with eager execution.

    tf.contrib.eager.EagerVariableStore(
        store=None
    )

When eager execution is enabled Variables get deleted when they go out of
scope, and are not stored in global collections by default. A lot of code
(mostly the functional layers in tf.layers) assumes that variables are kept in
a global list.

EagerVariableStore can be used in conjunction with this code to make it
eager-friendly. For example, to create a dense layer, use:

      container = tfe.EagerVariableStore()
      for input in dataset_iterator:
        with container.as_default():
          x = tf.compat.v1.layers.dense(input, name="l1")
      print(container.variables)  # Should print the variables used in the layer.

## Methods

### `as_default`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variable_scope.py#L1418-L1419)

    as_default()

### `copy`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variable_scope.py#L1436-L1461)

    copy()

Copy this variable store and all of its contents.

Variables contained in this store will be copied over to the new variable
store, meaning that they can be modified without affecting the variables in
this store.

<br />

<br />

<br />

| Returns ||
|---|---|
| A new EagerVariableStore instance containing copied variables. ||

<br />

### `non_trainable_variables`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variable_scope.py#L1430-L1433)

    non_trainable_variables()

### `trainable_variables`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variable_scope.py#L1424-L1427)

    trainable_variables()

### `variables`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variable_scope.py#L1421-L1422)

    variables()