parameters: (tensor_name)
docstring: Parses a tensor name into an operation name and output index.
  
    This function will canonicalize tensor names as follows:
  
    * "foo:0"       -> ("foo", 0)
    * "foo:7"       -> ("foo", 7)
    * "foo"         -> ("foo", 0)
    * "foo:bar:baz" -> ValueError
  
    Args:
      tensor_name: The name of a tensor.
  
    Returns:
      A tuple containing the operation name, and the output index.
  
    Raises:
      ValueError: If `tensor_name' cannot be interpreted as the name of a tensor.
docstring_summary: Parses a tensor name into an operation name and output index.
docstring_tokens: Parses a tensor name into an operation name and output index .
function: def _ParseTensorName(tensor_name):
    """Parses a tensor name into an operation name and output index.
  
    This function will canonicalize tensor names as follows:
  
    * "foo:0"       -> ("foo", 0)
    * "foo:7"       -> ("foo", 7)
    * "foo"         -> ("foo", 0)
    * "foo:bar:baz" -> ValueError
  
    Args:
      tensor_name: The name of a tensor.
  
    Returns:
      A tuple containing the operation name, and the output index.
  
    Raises:
      ValueError: If `tensor_name' cannot be interpreted as the name of a tensor.
    """
    components = tensor_name.split(':')
    if len(components) == 2:
      # Expected format: 'operation_name:output_index'.
      try:
        output_index = int(components[1])
      except ValueError:
        raise ValueError('Cannot convert %r to a tensor name.' % (tensor_name,))
      return components[0], output_index
    elif len(components) == 1:
      # Expected format: 'operation_name' (implicit 0th output).
      return components[0], 0
    else:
      raise ValueError('Cannot convert %r to a tensor name.' % (tensor_name,))
function_tokens: def _ParseTensorName ( tensor_name ) : components = tensor_name . split ( ':' ) if len ( components ) == 2 : # Expected format: 'operation_name:output_index'. try : output_index = int ( components [ 1 ] ) except ValueError : raise ValueError ( 'Cannot convert %r to a tensor name.' % ( tensor_name , ) ) return components [ 0 ] , output_index elif len ( components ) == 1 : # Expected format: 'operation_name' (implicit 0th output). return components [ 0 ] , 0 else : raise ValueError ( 'Cannot convert %r to a tensor name.' % ( tensor_name , ) )