class_docstr: Gathers and serializes a checkpoint view.
  
  This is for loading specific portions of a module from a
  checkpoint, and be able to compare two modules by matching components.
  
  Example usage:
  
  >>> class SimpleModule(tf.Module):
  ...   def __init__(self, name=None):
  ...     super().__init__(name=name)
  ...     self.a_var = tf.Variable(5.0)
  ...     self.b_var = tf.Variable(4.0)
  ...     self.vars = [tf.Variable(1.0), tf.Variable(2.0)]
  
  >>> root = SimpleModule(name="root")
  >>> root.leaf = SimpleModule(name="leaf")
  >>> ckpt = tf.train.Checkpoint(root)
  >>> save_path = ckpt.save('/tmp/tf_ckpts')
  >>> checkpoint_view = tf.train.CheckpointView(save_path)
  
  Pass `node_id=0` to `tf.train.CheckpointView.children()` to get the dictionary
  of all children directly linked to the checkpoint root.
  
  >>> for name, node_id in checkpoint_view.children(0).items():
  ...   print(f"- name: '{name}', node_id: {node_id}")
  - name: 'a_var', node_id: 1
  - name: 'b_var', node_id: 2
  - name: 'vars', node_id: 3
  - name: 'leaf', node_id: 4
  - name: 'root', node_id: 0
  - name: 'save_counter', node_id: 5
class_docstr_tok: ["Gathers","and","serializes","a","checkpoint","view",".","This","is","for","loading","specific","portions","of","a","module","from","a","checkpoint",",","and","be","able","to","compare","two","modules","by","matching","components",".","Example","usage",":",">",">",">","class","SimpleModule","(","tf.Module",")",":","...","def","__init__","(","self",",","name=None",")",":","...","super","(",")",".__init__","(","name=name",")","...","self.a_var","=","tf.Variable","(","5.0",")","...","self.b_var","=","tf.Variable","(","4.0",")","...","self.vars","=","[","tf.Variable","(","1.0",")",",","tf.Variable","(","2.0",")","]",">",">",">","root","=","SimpleModule","(","name=","''","root","''",")",">",">",">","root.leaf","=","SimpleModule","(","name=","''","leaf","''",")",">",">",">","ckpt","=","tf.train.Checkpoint","(","root",")",">",">",">","save_path","=","ckpt.save","(","'\/tmp\/tf_ckpts","'",")",">",">",">","checkpoint_view","=","tf.train.CheckpointView","(","save_path",")","Pass","`","node_id=0","`","to","`","tf.train.CheckpointView.children","(",")","`","to","get","the","dictionary","of","all","children","directly","linked","to","the","checkpoint","root",".",">",">",">","for","name",",","node_id","in","checkpoint_view.children","(","0",")",".items","(",")",":","...","print","(","f","''","-","name",":","'","{","name","}","'",",","node_id",":","{","node_id","}","''",")","-","name",":","'a_var","'",",","node_id",":","1","-","name",":","'b_var","'",",","node_id",":","2","-","name",":","'vars","'",",","node_id",":","3","-","name",":","'leaf","'",",","node_id",":","4","-","name",":","'root","'",",","node_id",":","0","-","name",":","'save_counter","'",",","node_id",":","5"]
docstr: Returns a dict of descendants by node_id and paths to node.
  
  The names returned by this private method are subject to change.
docstr_tok: ["Returns","a","dict","of","descendants","by","node_id","and","paths","to","node",".","The","names","returned","by","this","private","method","are","subject","to","change","."]
code: def _descendants_with_paths(self):
      """Returns a dict of descendants by node_id and paths to node.
  
      The names returned by this private method are subject to change.
      """
  
      all_nodes_with_paths = {}
      to_visit = collections.deque([0])
      # node_id:0 will always be "root".
      all_nodes_with_paths[0] = "root"
      path = all_nodes_with_paths.get(0)
      while to_visit:
          node_id = to_visit.popleft()
          obj = self._object_graph_proto.nodes[node_id]
          for child in obj.children:
              if (
                  child.node_id == 0
                  or child.node_id in all_nodes_with_paths.keys()
              ):
                  continue
              path = all_nodes_with_paths.get(node_id)
              if child.node_id not in all_nodes_with_paths.keys():
                  to_visit.append(child.node_id)
              all_nodes_with_paths[child.node_id] = (
                  path + "." + child.local_name
              )
      return all_nodes_with_paths
  
file_path: tensorflow/tensorflow/python/checkpoint/checkpoint_view.py
imports: import collections
  from tensorflow.core.protobuf import trackable_object_graph_pb2
  from tensorflow.python.checkpoint import trackable_view
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.trackable import base
  from tensorflow.python.training import py_checkpoint_reader
  from tensorflow.python.util import object_identity
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling the CheckpointView obj's underlying member method code with example usage: obj._descendants_with_paths() and returns: all_nodes_with_paths