# tf.contrib.checkpoint.NoDependency

<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/training/tracking/data_structures.py#L41-L63) |

Allows attribute assignment to `Trackable` objects with no dependency.

    tf.contrib.checkpoint.NoDependency(
        value
    )

#### Example usage:

    obj = Trackable()
    obj.has_dependency = tf.Variable(0., name="dep")
    obj.no_dependency = NoDependency(tf.Variable(1., name="nodep"))
    assert obj.no_dependency.name == "nodep:0"

`obj` in this example has a dependency on the variable "dep", and both
attributes contain un-wrapped `Variable` objects.

`NoDependency` also works with [`tf.keras.Model`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/Model), but only for checkpoint
dependencies: wrapping a `Layer` in `NoDependency` will assign the (unwrapped)
`Layer` to the attribute without a checkpoint dependency, but the `Model` will
still track the `Layer` (so it will appear in [`Model.layers`](https://www.tensorflow.org/api_docs/python/tf/keras/Model#layers), and its
variables will appear in `Model.variables`).