def _create_checkpoint_manager(self, max_to_keep: int=5, load_model: bool=True) -> None:
    '\n        Create a checkpoint manager in order to be able to make the training\n        fault-tolerant.\n        Args:\n          max_to_keep: the maximum number of checkpoints to keep in the checkpoint path.\n          load_model: if we want to start the training from the latest checkpoint.\n        '
    ckpt = tf.train.Checkpoint(optimizer=self.optimizer, model=self.model)
    self.model.ckpt_manager = tf.train.CheckpointManager(ckpt, PREFIX_CHECKPOINT_DIR, max_to_keep=max_to_keep)
    if load_model:
        ckpt.restore(self.model.ckpt_manager.latest_checkpoint).expect_partial()
Create a checkpoint manager in order to be able to make the training
fault-tolerant.
Args:
  max_to_keep: the maximum number of checkpoints to keep in the checkpoint path.
  load_model: if we want to start the training from the latest checkpoint.
def _create_checkpoint_manager(self, max_to_keep: int=5, load_model: bool=True) -> None:
    '\n        Create a checkpoint manager in order to be able to make the training\n        fault-tolerant.\n        Args:\n          max_to_keep: the maximum number of checkpoints to keep in the checkpoint path.\n          load_model: if we want to start the training from the latest checkpoint.\n        '
    ckpt = tf.train.Checkpoint(optimizer=self.optimizer, model=self.model)
    self.model.ckpt_manager = tf.train.CheckpointManager(ckpt, PREFIX_CHECKPOINT_DIR, max_to_keep=max_to_keep)
    if load_model:
        ckpt.restore(self.model.ckpt_manager.latest_checkpoint).expect_partial()