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

    Returns:
      A dictionary that can easily be serialized to JSON.
    """
    return {
        "source_index": self.source,
        "target_index": self.target,
        "data": self.data,
    }
Returns a simplified dictionary representing the Vertex.

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