class_docstr: Training state management class.
  
  This class provides apis for backing up and restoring the training state.
  This allows model and epoch information to be saved periodically and restore
  for fault-tolerance, also known as preemption-recovery purpose.
class_docstr_tok: ["Training","state","management","class",".","This","class","provides","apis","for","backing","up","and","restoring","the","training","state",".","This","allows","model","and","epoch","information","to","be","saved","periodically","and","restore","for","fault-tolerance",",","also","known","as","preemption-recovery","purpose","."]
docstr: Delete the backup directories.
  
  Delete the backup directories which should not exist after `fit()`
  successfully finishes.
docstr_tok: ["Delete","the","backup","directories",".","Delete","the","backup","directories","which","should","not","exist","after","`","fit","(",")","`","successfully","finishes","."]
code: def delete_backup(self):
      """Delete the backup directories.
  
      Delete the backup directories which should not exist after `fit()`
      successfully finishes.
      """
      if self.write_checkpoint_manager is self.read_checkpoint_manager:
          try:
              file_io.delete_recursively_v2(
                  self.write_checkpoint_manager.directory
              )
          except errors.NotFoundError:
              pass
  
file_path: tensorflow-upstream/tensorflow/python/keras/distribute/worker_training_state.py
imports: import os
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.distribute import distributed_file_utils
  from tensorflow.python.keras.utils import mode_keys
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import variables
label_desc: Use image node_id 4 for calling the WorkerTrainingState obj's underlying member method code with example usage: obj.delete_backup() without return types