code: def _store_checkpoint(self, sess, saver, global_step):
      
      if not self._logdir or not saver:
        return
      tf.gfile.MakeDirs(self._logdir)
      filename = os.path.join(self._logdir, 'model.ckpt')
      saver.save(sess, filename, global_step)
docs: Store a checkpoint if a log directory was provided to the constructor.
  
      The directory will be created if needed.
  
      Args:
        sess: Session containing variables to store.
        saver: Saver used for checkpointing.
        global_step: Step number of the checkpoint name.