parameters: (elem)
return_statement: return elem.name if hasattr(elem, "name") else str(elem)
docstring: Obtain the name or string representation of a graph element.
  
    If the graph element has the attribute "name", return name. Otherwise, return
    a __str__ representation of the graph element. Certain graph elements, such as
    `SparseTensor`s, do not have the attribute "name".
  
    Args:
      elem: The graph element in question.
  
    Returns:
      If the attribute 'name' is available, return the name. Otherwise, return
      str(fetch).
docstring_summary: Obtain the name or string representation of a graph element.
docstring_tokens: Obtain the name or string representation of a graph element .
function: def get_graph_element_name(elem):
    """Obtain the name or string representation of a graph element.
  
    If the graph element has the attribute "name", return name. Otherwise, return
    a __str__ representation of the graph element. Certain graph elements, such as
    `SparseTensor`s, do not have the attribute "name".
  
    Args:
      elem: The graph element in question.
  
    Returns:
      If the attribute 'name' is available, return the name. Otherwise, return
      str(fetch).
    """
  
    return elem.name if hasattr(elem, "name") else str(elem)
function_tokens: def get_graph_element_name ( elem ) : return elem . name if hasattr ( elem , "name" ) else str ( elem )