# tf.contrib.checkpoint.UniqueNameTracker

<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/checkpoint/python/containers.py#L24-L84) |

Adds dependencies on trackable objects with name hints.

    tf.contrib.checkpoint.UniqueNameTracker()

Useful for creating dependencies with locally unique names.

#### Example usage:

    class SlotManager(tf.contrib.checkpoint.Checkpointable):

      def __init__(self):
        # Create a dependency named "slotdeps" on the container.
        self.slotdeps = tf.contrib.checkpoint.UniqueNameTracker()
        slotdeps = self.slotdeps
        slots = []
        slots.append(slotdeps.track(tf.Variable(3.), "x"))  # Named "x"
        slots.append(slotdeps.track(tf.Variable(4.), "y"))
        slots.append(slotdeps.track(tf.Variable(5.), "x"))  # Named "x_1"

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `layers` | <br /> <br /> |
| `losses` | Aggregate losses from any `Layer` instances. |
| `non_trainable_variables` | <br /> <br /> |
| `non_trainable_weights` | <br /> <br /> |
| `trainable` | <br /> <br /> |
| `trainable_variables` | <br /> <br /> |
| `trainable_weights` | <br /> <br /> |
| `updates` | Aggregate updates from any `Layer` instances. |
| `variables` | <br /> <br /> |
| `weights` | <br /> <br /> |

<br />

## Methods

### `track`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/checkpoint/python/containers.py#L53-L84)

    track(
        trackable, base_name
    )

Add a dependency on `trackable`.

<br />

<br />

<br />

| Args ||
|---|---|
| `trackable` | An object to add a checkpoint dependency on. |
| `base_name` | A name hint, which is uniquified to determine the dependency name. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `trackable`, for chaining. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If `trackable` is not a trackable object. |

<br />

### `__eq__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/training/tracking/data_structures.py#L247-L250)

    __eq__(
        other
    )

Return self==value.