def __init__(self, checkpoint_dir, save_secs=None, save_steps=None, saver=None, checkpoint_basename='model.ckpt', scaffold=None):
    'Initialize CheckpointSaver monitor.\n\n    Args:\n      checkpoint_dir: `str`, base directory for the checkpoint files.\n      save_secs: `int`, save every N secs.\n      save_steps: `int`, save every N steps.\n      saver: `Saver` object, used for saving.\n      checkpoint_basename: `str`, base name for the checkpoint files.\n      scaffold: `Scaffold`, use to get saver object.\n\n    Raises:\n      ValueError: If both `save_steps` and `save_secs` are not `None`.\n      ValueError: If both `save_steps` and `save_secs` are `None`.\n    '
    logging.info('Create CheckpointSaver.')
    super(CheckpointSaver, self).__init__()
    self._saver = saver
    self._summary_writer = SummaryWriterCache.get(checkpoint_dir)
    self._save_path = os.path.join(checkpoint_dir, checkpoint_basename)
    self._scaffold = scaffold
    self._save_secs = save_secs
    self._save_steps = save_steps
    self._last_saved_time = None
    self._last_begin_step = None
    self._last_saved_step = None
    if ((save_steps is None) and (save_secs is None)):
        raise ValueError('Either save_steps or save_secs should be provided')
    if ((save_steps is not None) and (save_secs is not None)):
        raise ValueError('Can not provide both save_steps and save_secs.')
Initialize CheckpointSaver monitor.

Args:
  checkpoint_dir: `str`, base directory for the checkpoint files.
  save_secs: `int`, save every N secs.
  save_steps: `int`, save every N steps.
  saver: `Saver` object, used for saving.
  checkpoint_basename: `str`, base name for the checkpoint files.
  scaffold: `Scaffold`, use to get saver object.

Raises:
  ValueError: If both `save_steps` and `save_secs` are not `None`.
  ValueError: If both `save_steps` and `save_secs` are `None`.
def __init__(self, checkpoint_dir, save_secs=None, save_steps=None, saver=None, checkpoint_basename='model.ckpt', scaffold=None):
    'Initialize CheckpointSaver monitor.\n\n    Args:\n      checkpoint_dir: `str`, base directory for the checkpoint files.\n      save_secs: `int`, save every N secs.\n      save_steps: `int`, save every N steps.\n      saver: `Saver` object, used for saving.\n      checkpoint_basename: `str`, base name for the checkpoint files.\n      scaffold: `Scaffold`, use to get saver object.\n\n    Raises:\n      ValueError: If both `save_steps` and `save_secs` are not `None`.\n      ValueError: If both `save_steps` and `save_secs` are `None`.\n    '
    logging.info('Create CheckpointSaver.')
    super(CheckpointSaver, self).__init__()
    self._saver = saver
    self._summary_writer = SummaryWriterCache.get(checkpoint_dir)
    self._save_path = os.path.join(checkpoint_dir, checkpoint_basename)
    self._scaffold = scaffold
    self._save_secs = save_secs
    self._save_steps = save_steps
    self._last_saved_time = None
    self._last_begin_step = None
    self._last_saved_step = None
    if ((save_steps is None) and (save_secs is None)):
        raise ValueError('Either save_steps or save_secs should be provided')
    if ((save_steps is not None) and (save_secs is not None)):
        raise ValueError('Can not provide both save_steps and save_secs.')