def to_dict(self):
    """Returns a simplified dictionary representing the Vertex.

    Returns:
      A dictionary that can easily be serialized to JSON.
    """
    return {
        "in_edge_index": self.in_edges,
        "out_edge_index": self.out_edges,
    }
Returns a simplified dictionary representing the Vertex.

    Returns:
      A dictionary that can easily be serialized to JSON.
    
tensor2tensor/insights/graph.py