class_docstr: Saves checkpoints every N steps or seconds.
class_docstr_tok: ["Saves","checkpoints","every","N","steps","or","seconds","."]
code: def end(self, session: session_lib.Session):
      if self._save_thread:
          logging.info("Waiting for any pending checkpoints to finish.")
          self._save_thread.join()
      if self._write_graph_thread:
          logging.info("Waiting for any pending write_graph to finish.")
          self._write_graph_thread.join()
  
      last_step = session.run(self._global_step_tensor)
  
      if self._last_checkpoint_step != last_step:
          self._save(session, last_step, asynchronous=False)
  
      for l in self._listeners:
          l.end(session, last_step)
  
imports: import os
  import threading
  import time
  from typing import Any, List, Optional, Text
  from tensorflow.core.util import event_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model.pywrap_saved_model import metrics
  from tensorflow.python.training import basic_session_run_hooks
  from tensorflow.python.training import monitored_session
  from tensorflow.python.training import saver
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training import training_util
  from tensorflow.python.training.summary_io import SummaryWriterCache
label_desc: Use image node_id 7 for calling the AsyncCheckpointSaverHook obj's underlying member method code with example usage: obj.end(session) without return types