parameters: (graph_def)
docstring: Makes sure that the graph is internally consistent.
  
    Checks basic properties of the graph def and raises an exception if there are
    input references to missing nodes, duplicated names, or other logic errors.
  
    Args:
      graph_def: Definition of a graph to be checked.
  
    Raises:
      ValueError: If the graph is incorrectly constructed.
docstring_summary: Makes sure that the graph is internally consistent.
docstring_tokens: Makes sure that the graph is internally consistent .
function: def ensure_graph_is_valid(graph_def):
    """Makes sure that the graph is internally consistent.
  
    Checks basic properties of the graph def and raises an exception if there are
    input references to missing nodes, duplicated names, or other logic errors.
  
    Args:
      graph_def: Definition of a graph to be checked.
  
    Raises:
      ValueError: If the graph is incorrectly constructed.
    """
    node_map = {}
    for node in graph_def.node:
      if node.name not in node_map.keys():
        node_map[node.name] = node
      else:
        raise ValueError("Duplicate node names detected for ", node.name)
    for node in graph_def.node:
      for input_name in node.input:
        input_node_name = node_name_from_input(input_name)
        if input_node_name not in node_map.keys():
          raise ValueError("Input for ", node.name, " not found: ", input_name)
function_tokens: def ensure_graph_is_valid ( graph_def ) : node_map = { } for node in graph_def . node : if node . name not in node_map . keys ( ) : node_map [ node . name ] = node else : raise ValueError ( "Duplicate node names detected for " , node . name ) for node in graph_def . node : for input_name in node . input : input_node_name = node_name_from_input ( input_name ) if input_node_name not in node_map . keys ( ) : raise ValueError ( "Input for " , node . name , " not found: " , input_name )