Type UniqueNameTracker
Namespace tensorflow.contrib.checkpoint
Parent TrackableDataStructure
Interfaces IUniqueNameTracker
Adds dependencies on trackable objects with name hints. Useful for creating dependencies with locally unique names. Example usage:
Show Example
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"
Methods
Properties
- layers
- layers_dyn
- losses
- losses_dyn
- non_trainable_variables
- non_trainable_variables_dyn
- non_trainable_weights
- non_trainable_weights_dyn
- PythonObject
- trainable
- trainable_dyn
- trainable_variables
- trainable_variables_dyn
- trainable_weights
- trainable_weights_dyn
- updates
- updates_dyn
- variables
- variables_dyn
- weights
- weights_dyn
Public instance methods
object track(Dense trackable, string base_name)
Add a dependency on `trackable`.
Parameters
-
Dense
trackable - An object to add a checkpoint dependency on.
-
string
base_name - A name hint, which is uniquified to determine the dependency name.
Returns
-
object
- `trackable`, for chaining.
object track(ResourceVariable trackable, string base_name)
Add a dependency on `trackable`.
Parameters
-
ResourceVariable
trackable - An object to add a checkpoint dependency on.
-
string
base_name - A name hint, which is uniquified to determine the dependency name.
Returns
-
object
- `trackable`, for chaining.
object track_dyn(object trackable, object base_name)
Add a dependency on `trackable`.
Parameters
-
object
trackable - An object to add a checkpoint dependency on.
-
object
base_name - A name hint, which is uniquified to determine the dependency name.
Returns
-
object
- `trackable`, for chaining.