class_docstr: Handles training restarts.
  
  Particularly useful when sharing parameters (and checkpoints) between models.
  
  Args:
    model_mode (str): Model "mode". Different modes have different local step
        counters, but the same global step counter. Also used in log messages.
    checkpoint_dir (str): Model checkpoint directory. Global step is inferred
        from the name of the last checkpoint.
    target_local_step (int): Local step to train the model up to.
  
  Attributes:
    model_mode (str): See args.
    checkpoint_dir (str): See args.
    target_local_step (int): See args.
    target_global_step (int): Calculated global step to train the model up to.
    should_skip (bool): Whether training should be skipped because the number of
        local steps already done is higher than the target. This happens during
        restarts.
    steps_to_go: how many steps to go.
    restarting (bool): Whether the current epoch of training has been
        interrupted and is being restarted.
code: def _write_counters(self, local_step, global_step):
      with tf.gfile.Open(self._counter_path, "w") as f:
          f.write("{} {}".format(local_step, global_step))
  
file_path: tensor2tensor/tensor2tensor/rl/restarter.py
imports: import contextlib
  import os
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the Restarter obj's underlying member method code with example usage: obj._write_counters(local_step, global_step) without return types