(self)
return ret_dict
Returns a dictionary for serialization to JSON.

    Each member is converted to an elementary type that can be serialized to
    JSON readily.
Returns a dictionary for serialization to JSON.
Returns a dictionary for serialization to JSON .
def to_dict(self):
    """Returns a dictionary for serialization to JSON.

    Each member is converted to an elementary type that can be serialized to
    JSON readily.
    """
    # Start with the dict representation of the namedtuple
    ret_dict = self._asdict()
    # Add the class name for reconstruction when deserialized
    ret_dict['__class__'] = self.__class__.__name__
    # Convert the graph for each split into a serializable form
    split_subgraphs = {}
    for split, subgraph in six.iteritems(ret_dict['split_subgraphs']):
      exported_subgraph = imagenet_specification.export_graph(subgraph)
      split_subgraphs[split.name] = exported_subgraph
    ret_dict['split_subgraphs'] = split_subgraphs
    # WordNet synsets to their WordNet ID as a string in images_per_class.
    images_per_class = {}
    for split, synset_counts in six.iteritems(ret_dict['images_per_class']):
      wn_id_counts = {
          synset.wn_id: count for synset, count in six.iteritems(synset_counts)
      }
      images_per_class[split.name] = wn_id_counts
    ret_dict['images_per_class'] = images_per_class

    return ret_dict
def to_dict ( self ) : # Start with the dict representation of the namedtuple ret_dict = self . _asdict ( ) # Add the class name for reconstruction when deserialized ret_dict [ '__class__' ] = self . __class__ . __name__ # Convert the graph for each split into a serializable form split_subgraphs = { } for split , subgraph in six . iteritems ( ret_dict [ 'split_subgraphs' ] ) : exported_subgraph = imagenet_specification . export_graph ( subgraph ) split_subgraphs [ split . name ] = exported_subgraph ret_dict [ 'split_subgraphs' ] = split_subgraphs # WordNet synsets to their WordNet ID as a string in images_per_class. images_per_class = { } for split , synset_counts in six . iteritems ( ret_dict [ 'images_per_class' ] ) : wn_id_counts = { synset . wn_id : count for synset , count in six . iteritems ( synset_counts ) } images_per_class [ split . name ] = wn_id_counts ret_dict [ 'images_per_class' ] = images_per_class return ret_dict