# tf.contrib.distribute.UpdateContext

<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/distribute/distribute_lib.py#L152-L165) |

Context manager when you are in `update()` or `update_non_slot()`.

    tf.contrib.distribute.UpdateContext(
        device
    )

## Methods

### `__enter__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/distribute/distribute_lib.py#L159-L161)

    __enter__()

### `__exit__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/distribute/distribute_lib.py#L163-L165)

    __exit__(
        exception_type, exception_value, traceback
    )