parameters: (save_dir,
                              model_checkpoint_path,
                              all_model_checkpoint_paths=None,
                              latest_filename=None)
docstring: Updates the content of the 'checkpoint' file.
  
    This updates the checkpoint file containing a CheckpointState
    proto.
  
    Args:
      save_dir: Directory where the model was saved.
      model_checkpoint_path: The checkpoint file.
      all_model_checkpoint_paths: List of strings.  Paths to all not-yet-deleted
        checkpoints, sorted from oldest to newest.  If this is a non-empty list,
        the last element must be equal to model_checkpoint_path.  These paths
        are also saved in the CheckpointState proto.
      latest_filename: Optional name of the checkpoint file.  Default to
        'checkpoint'.
  
    Raises:
      RuntimeError: If the save paths conflict.
docstring_summary: Updates the content of the 'checkpoint' file.
docstring_tokens: Updates the content of the checkpoint file .
function: def update_checkpoint_state(save_dir,
                              model_checkpoint_path,
                              all_model_checkpoint_paths=None,
                              latest_filename=None):
    """Updates the content of the 'checkpoint' file.
  
    This updates the checkpoint file containing a CheckpointState
    proto.
  
    Args:
      save_dir: Directory where the model was saved.
      model_checkpoint_path: The checkpoint file.
      all_model_checkpoint_paths: List of strings.  Paths to all not-yet-deleted
        checkpoints, sorted from oldest to newest.  If this is a non-empty list,
        the last element must be equal to model_checkpoint_path.  These paths
        are also saved in the CheckpointState proto.
      latest_filename: Optional name of the checkpoint file.  Default to
        'checkpoint'.
  
    Raises:
      RuntimeError: If the save paths conflict.
    """
    # Writes the "checkpoint" file for the coordinator for later restoration.
    coord_checkpoint_filename = _GetCheckpointFilename(save_dir, latest_filename)
    ckpt = generate_checkpoint_state_proto(
        save_dir,
        model_checkpoint_path,
        all_model_checkpoint_paths=all_model_checkpoint_paths)
  
    if coord_checkpoint_filename == ckpt.model_checkpoint_path:
      raise RuntimeError("Save path '%s' conflicts with path used for "
                         "checkpoint state.  Please use a different save path." %
                         model_checkpoint_path)
  
    # Saves to a tmp file first.  On success, *atomically* renames it back.
    # This prevents a potential read/write race between this function and
    # get_checkpoint_state().
    temp_pathname = coord_checkpoint_filename + ".tmp." + uuid.uuid4().hex
    file_io.write_string_to_file(temp_pathname,
                                 text_format.MessageToString(ckpt))
    file_io.rename(temp_pathname, coord_checkpoint_filename, overwrite=True)
function_tokens: def update_checkpoint_state ( save_dir , model_checkpoint_path , all_model_checkpoint_paths = None , latest_filename = None ) : # Writes the "checkpoint" file for the coordinator for later restoration. coord_checkpoint_filename = _GetCheckpointFilename ( save_dir , latest_filename ) ckpt = generate_checkpoint_state_proto ( save_dir , model_checkpoint_path , all_model_checkpoint_paths = all_model_checkpoint_paths ) if coord_checkpoint_filename == ckpt . model_checkpoint_path : raise RuntimeError ( "Save path '%s' conflicts with path used for " "checkpoint state.  Please use a different save path." % model_checkpoint_path ) # Saves to a tmp file first.  On success, *atomically* renames it back. # This prevents a potential read/write race between this function and # get_checkpoint_state(). temp_pathname = coord_checkpoint_filename + ".tmp." + uuid . uuid4 ( ) . hex file_io . write_string_to_file ( temp_pathname , text_format . MessageToString ( ckpt ) ) file_io . rename ( temp_pathname , coord_checkpoint_filename , overwrite = True )