class_docstr: Indicates a position within a `_CheckpointRestoreCoordinator`.
class_docstr_tok: ["Indicates","a","position","within","a","`","_CheckpointRestoreCoordinator","`","."]
docstr: Restore the bound Trackable and dependencies (may be deferred).
docstr_tok: ["Restore","the","bound","Trackable","and","dependencies","(","may","be","deferred",")","."]
code: def _restore_descendants(self, reader=None):
      """Restore the bound Trackable and dependencies (may be deferred)."""
      # Attempt a breadth-first traversal, since presumably the user has more
      # control over shorter paths. If we don't have all of the dependencies at
      # this point, the end result is not breadth-first (since other deferred
      # traversals will happen later).
  
      # You may be wondering why elements in the `visit_queue` are tuples that
      # contains both CheckpointPositions and their Trackable. The reason is that
      # Optimizers will not keep a strong reference to slot vars for
      # ShardedVariables. The slot variable must be kept in memory until the
      # restore saveables have been created.
      visit_queue = collections.deque([(self, self.trackable)])
      restore_ops = []
      tensor_saveables = {}
      python_positions = []
      registered_savers = collections.defaultdict(dict)
      while visit_queue:
          current_position, _ = visit_queue.popleft()
  
          # Restore using the ops defined in a Saveable or registered function.
          (
              new_restore_ops,
              new_tensor_saveables,
              new_python_positions,
              new_registered_savers,
          ) = (
              current_position._single_restore()
          )  # pylint: disable=protected-access
          restore_ops.extend(new_restore_ops)
          tensor_saveables.update(new_tensor_saveables)
          python_positions.extend(new_python_positions)
          for (
              saver_name,
              trackable_map,
          ) in new_registered_savers.items():
              registered_savers[saver_name].update(trackable_map)
  
          # Pass the restoration to the dependencies.
          _queue_children_for_restoration(current_position, visit_queue)
          _queue_slot_variables(current_position, visit_queue)
  
      restore_ops.extend(
          current_position.checkpoint.restore_saveables(
              tensor_saveables,
              python_positions,
              registered_savers,
              reader=reader,
          )
      )
      return restore_ops
  
imports: import collections
  from tensorflow.python.checkpoint import checkpoint_view
  from tensorflow.python.checkpoint import functional_saver
  from tensorflow.python.checkpoint import save_util_v1
  from tensorflow.python.checkpoint import saveable_compat
  from tensorflow.python.eager import context
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_io_ops
  from tensorflow.python.ops import io_ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model import registration
  from tensorflow.python.trackable import base
  from tensorflow.python.trackable import constants
  from tensorflow.python.trackable import python_state
  from tensorflow.python.trackable import trackable_utils
  from tensorflow.python.training.saving import saveable_object_util
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 21 for calling the CheckpointPosition obj's underlying member method code with example usage: obj._restore_descendants(reader) and returns: restore_ops