parameters: (self, sess, save_path, global_step=None, latest_filename=None,
             meta_graph_suffix="meta", write_meta_graph=True)
return_statement: return model_checkpoint_path
docstring: Saves variables.
  
      This method runs the ops added by the constructor for saving variables.
      It requires a session in which the graph was launched.  The variables to
      save must also have been initialized.
  
      The method returns the path of the newly created checkpoint file.  This
      path can be passed directly to a call to `restore()`.
  
      Args:
        sess: A Session to use to save the variables.
        save_path: String.  Path to the checkpoint filename.  If the saver is
          `sharded`, this is the prefix of the sharded checkpoint filename.
        global_step: If provided the global step number is appended to
          `save_path` to create the checkpoint filename. The optional argument
          can be a `Tensor`, a `Tensor` name or an integer.
        latest_filename: Optional name for the protocol buffer file that will
          contains the list of most recent checkpoint filenames.  That file,
          kept in the same directory as the checkpoint files, is automatically
          managed by the saver to keep track of recent checkpoints.  Defaults to
          'checkpoint'.
        meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
        write_meta_graph: `Boolean` indicating whether or not to write the meta
          graph file.
  
      Returns:
        A string: path at which the variables were saved.  If the saver is
          sharded, this string ends with: '-?????-of-nnnnn' where 'nnnnn'
          is the number of shards created.
  
      Raises:
        TypeError: If `sess` is not a `Session`.
        ValueError: If `latest_filename` contains path components, or if it
          collides with `save_path`.
docstring_summary: Saves variables.
docstring_tokens: Saves variables .
function: def save(self, sess, save_path, global_step=None, latest_filename=None,
             meta_graph_suffix="meta", write_meta_graph=True):
      """Saves variables.
  
      This method runs the ops added by the constructor for saving variables.
      It requires a session in which the graph was launched.  The variables to
      save must also have been initialized.
  
      The method returns the path of the newly created checkpoint file.  This
      path can be passed directly to a call to `restore()`.
  
      Args:
        sess: A Session to use to save the variables.
        save_path: String.  Path to the checkpoint filename.  If the saver is
          `sharded`, this is the prefix of the sharded checkpoint filename.
        global_step: If provided the global step number is appended to
          `save_path` to create the checkpoint filename. The optional argument
          can be a `Tensor`, a `Tensor` name or an integer.
        latest_filename: Optional name for the protocol buffer file that will
          contains the list of most recent checkpoint filenames.  That file,
          kept in the same directory as the checkpoint files, is automatically
          managed by the saver to keep track of recent checkpoints.  Defaults to
          'checkpoint'.
        meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
        write_meta_graph: `Boolean` indicating whether or not to write the meta
          graph file.
  
      Returns:
        A string: path at which the variables were saved.  If the saver is
          sharded, this string ends with: '-?????-of-nnnnn' where 'nnnnn'
          is the number of shards created.
  
      Raises:
        TypeError: If `sess` is not a `Session`.
        ValueError: If `latest_filename` contains path components, or if it
          collides with `save_path`.
      """
      if latest_filename is None:
        latest_filename = "checkpoint"
  
      if os.path.split(latest_filename)[0]:
        raise ValueError("'latest_filename' must not contain path components")
  
      if global_step is not None:
        if not isinstance(global_step, compat.integral_types):
          global_step = training_util.global_step(sess, global_step)
        checkpoint_file = "%s-%d" % (save_path, global_step)
      else:
        checkpoint_file = save_path
        if os.path.basename(
            save_path) == latest_filename and not self.saver_def.sharded:
          # Guard against collision between data file and checkpoint state file.
          raise ValueError(
              "'latest_filename' collides with 'save_path': '%s' and '%s'" %
              (latest_filename, save_path))
  
      save_path = os.path.dirname(save_path)
      if not isinstance(sess, session.SessionInterface):
        raise TypeError("'sess' must be a Session; %s" % sess)
  
      model_checkpoint_path = sess.run(
          self.saver_def.save_tensor_name,
          {self.saver_def.filename_tensor_name: checkpoint_file})
      model_checkpoint_path = compat.as_str(model_checkpoint_path)
      self._MaybeDeleteOldCheckpoints(model_checkpoint_path,
                                      meta_graph_suffix=meta_graph_suffix)
      update_checkpoint_state(save_path, model_checkpoint_path,
                              self.last_checkpoints, latest_filename)
      if write_meta_graph:
        meta_graph_filename = self._MetaGraphFilename(
            checkpoint_file, meta_graph_suffix=meta_graph_suffix)
        with sess.graph.as_default():
          self.export_meta_graph(meta_graph_filename)
  
      return model_checkpoint_path
function_tokens: def save ( self , sess , save_path , global_step = None , latest_filename = None , meta_graph_suffix = "meta" , write_meta_graph = True ) : if latest_filename is None : latest_filename = "checkpoint" if os . path . split ( latest_filename ) [ 0 ] : raise ValueError ( "'latest_filename' must not contain path components" ) if global_step is not None : if not isinstance ( global_step , compat . integral_types ) : global_step = training_util . global_step ( sess , global_step ) checkpoint_file = "%s-%d" % ( save_path , global_step ) else : checkpoint_file = save_path if os . path . basename ( save_path ) == latest_filename and not self . saver_def . sharded : # Guard against collision between data file and checkpoint state file. raise ValueError ( "'latest_filename' collides with 'save_path': '%s' and '%s'" % ( latest_filename , save_path ) ) save_path = os . path . dirname ( save_path ) if not isinstance ( sess , session . SessionInterface ) : raise TypeError ( "'sess' must be a Session; %s" % sess ) model_checkpoint_path = sess . run ( self . saver_def . save_tensor_name , { self . saver_def . filename_tensor_name : checkpoint_file } ) model_checkpoint_path = compat . as_str ( model_checkpoint_path ) self . _MaybeDeleteOldCheckpoints ( model_checkpoint_path , meta_graph_suffix = meta_graph_suffix ) update_checkpoint_state ( save_path , model_checkpoint_path , self . last_checkpoints , latest_filename ) if write_meta_graph : meta_graph_filename = self . _MetaGraphFilename ( checkpoint_file , meta_graph_suffix = meta_graph_suffix ) with sess . graph . as_default ( ) : self . export_meta_graph ( meta_graph_filename ) return model_checkpoint_path