parameters: (op_list)
return_statement: return names_to_saveables
docstring: Create a dictionary of names to operation lists.
  
      Args:
        op_list: A list, tuple, or set of Variables or SaveableObjects.
  
      Returns:
        A dictionary of names to the operations that must be saved under
        that name.  Variables with save_slice_info are grouped together under the
        same key in no particular order.
  
      Raises:
        TypeError: If the type of op_list or its elements is not supported.
        ValueError: If at least two saveables share the same name.
docstring_summary: Create a dictionary of names to operation lists.
docstring_tokens: Create a dictionary of names to operation lists .
function: def OpListToDict(op_list):
      """Create a dictionary of names to operation lists.
  
      Args:
        op_list: A list, tuple, or set of Variables or SaveableObjects.
  
      Returns:
        A dictionary of names to the operations that must be saved under
        that name.  Variables with save_slice_info are grouped together under the
        same key in no particular order.
  
      Raises:
        TypeError: If the type of op_list or its elements is not supported.
        ValueError: If at least two saveables share the same name.
      """
      if not isinstance(op_list, (list, tuple, set)):
        raise TypeError("Variables to save should be passed in a dict or a "
                        "list: %s" % op_list)
      op_list = set(op_list)
      names_to_saveables = {}
      # pylint: disable=protected-access
      for var in op_list:
        if isinstance(var, BaseSaverBuilder.SaveableObject):
          names_to_saveables[var.name] = var
        elif isinstance(var, variables.Variable) and var._save_slice_info:
          name = var._save_slice_info.full_name
          if name in names_to_saveables:
            if not isinstance(names_to_saveables[name], list):
              raise ValueError("Mixing slices and non-slices with the same name: "
                               "%s" % name)
            names_to_saveables[name].append(var)
          else:
            names_to_saveables[name] = [var]
        else:
          var = ops.convert_to_tensor(var, as_ref=True)
          if not BaseSaverBuilder._IsVariable(var):
            raise TypeError("Variable to save is not a Variable: %s" % var)
          name = var.op.name
          if name in names_to_saveables:
            raise ValueError("At least two variables have the same name: %s" %
                             name)
          names_to_saveables[name] = var
        # pylint: enable=protected-access
      return names_to_saveables
function_tokens: def OpListToDict ( op_list ) : if not isinstance ( op_list , ( list , tuple , set ) ) : raise TypeError ( "Variables to save should be passed in a dict or a " "list: %s" % op_list ) op_list = set ( op_list ) names_to_saveables = { } # pylint: disable=protected-access for var in op_list : if isinstance ( var , BaseSaverBuilder . SaveableObject ) : names_to_saveables [ var . name ] = var elif isinstance ( var , variables . Variable ) and var . _save_slice_info : name = var . _save_slice_info . full_name if name in names_to_saveables : if not isinstance ( names_to_saveables [ name ] , list ) : raise ValueError ( "Mixing slices and non-slices with the same name: " "%s" % name ) names_to_saveables [ name ] . append ( var ) else : names_to_saveables [ name ] = [ var ] else : var = ops . convert_to_tensor ( var , as_ref = True ) if not BaseSaverBuilder . _IsVariable ( var ) : raise TypeError ( "Variable to save is not a Variable: %s" % var ) name = var . op . name if name in names_to_saveables : raise ValueError ( "At least two variables have the same name: %s" % name ) names_to_saveables [ name ] = var # pylint: enable=protected-access return names_to_saveables