class_docstr: Class for scanning checkpoint directory and updating the checkpoint state
class_docstr_tok: ["Class","for","scanning","checkpoint","directory","and","updating","the","checkpoint","state"]
docstr: :param checkpoint_dir: path to checkpoint directory
  :param checkpoint_state_optional: If True, checkpoint state file is optional and if not found,
      directory is scanned to find the latest checkpoint. Default is True for backward compatibility
docstr_tok: [":","param","checkpoint_dir",":","path","to","checkpoint","directory",":","param","checkpoint_state_optional",":","If","True",",","checkpoint","state","file","is","optional","and","if","not","found",",","directory","is","scanned","to","find","the","latest","checkpoint",".","Default","is","True","for","backward","compatibility"]
code: def __init__(
      self, checkpoint_dir: str, checkpoint_state_optional: bool = True
  ):
      """
      :param checkpoint_dir: path to checkpoint directory
      :param checkpoint_state_optional: If True, checkpoint state file is optional and if not found,
          directory is scanned to find the latest checkpoint. Default is True for backward compatibility
      """
      self._checkpoint_dir = checkpoint_dir
      self._checkpoint_state_file = CheckpointStateFile(
          self._checkpoint_dir
      )
      self._checkpoint_state_optional = checkpoint_state_optional
  
imports: import os
  import re
  from typing import List, Union, Tuple
label_desc: Use image node_id 1 to create a new CheckpointStateReader object from inherited base classes: object with example: obj = CheckpointStateReader(checkpoint_dir, checkpoint_state_optional)