parameters: (self, vars_to_save)
return_statement: return sorted(per_device.items(), key=lambda t: t[0])
docstring: Group Variable tensor slices per device.
  
      TODO(touts): Make sure that all the devices found are on different
      job/replica/task/cpu|gpu.  It would be bad if 2 were on the same device.
      It can happen if the devices as unspecified.
  
      Args:
        vars_to_save: A list of BaseSaverBuilder.VarToSave objects.
  
      Returns:
        A list of tuples: (device_name, BaseSaverBuilder.VarToSave) tuples.
        The list is sorted by ascending device_name.
docstring_summary: Group Variable tensor slices per device.
docstring_tokens: Group Variable tensor slices per device .
function: def _GroupByDevices(self, vars_to_save):
      """Group Variable tensor slices per device.
  
      TODO(touts): Make sure that all the devices found are on different
      job/replica/task/cpu|gpu.  It would be bad if 2 were on the same device.
      It can happen if the devices as unspecified.
  
      Args:
        vars_to_save: A list of BaseSaverBuilder.VarToSave objects.
  
      Returns:
        A list of tuples: (device_name, BaseSaverBuilder.VarToSave) tuples.
        The list is sorted by ascending device_name.
      """
      per_device = collections.defaultdict(lambda: [])
      for var_to_save in vars_to_save:
        canonical_device = pydev.canonical_name(var_to_save.var.device)
        per_device[canonical_device].append(var_to_save)
      return sorted(per_device.items(), key=lambda t: t[0])
function_tokens: def _GroupByDevices ( self , vars_to_save ) : per_device = collections . defaultdict ( lambda : [ ] ) for var_to_save in vars_to_save : canonical_device = pydev . canonical_name ( var_to_save . var . device ) per_device [ canonical_device ] . append ( var_to_save ) return sorted ( per_device . items ( ) , key = lambda t : t [ 0 ] )