tf.contrib.checkpoint.split_dependency(
component_names,
component_dtypes,
fill_save_buffer_fn,
consume_restore_buffer_fn
)
Defined in tensorflow/contrib/checkpoint/python/split_dependency.py.
Creates multiple dependencies with a synchronized save/restore.
Useful when a single op produces Tensors which should each be saved under
different objects, or when Tensors saved with many different objects need to
be restored together as inputs to a single op (i.e. an object which uses a
single fused op may be swapped out for a subgraph of objects, and these two
programs are checkpoint compatible).
Args:
component_names: A sequence of names for the split dependencies.fill_save_buffer_fnmust add these keys to the dictionary it is passed, andconsume_restore_buffer_fnwill receive a dictionary with these keys.component_dtypes: Data types for theTensors being saved and restored, a sequence corresponding tocomponent_names.fill_save_buffer_fn: A function which takes an empty dictionary as an argument and addsTensors withcomponent_namesas keys. TheseTensors will be saved as if they were individual variables.consume_restore_buffer_fn: A function which takes a dictionary withcomponent_namesas keys mapping to restored individualTensors and returns a restore op (or if executing eagerly, runs the restoration and may returnNone).
Returns:
A dictionary mapping from names to Checkpointable objects. If one is reachable from an object as a dependency, the others should be too; adding dependencies on some but not all of the objects will result in errors.