(output_dir, host_id=None)
Checkpoint data counters.
Checkpoint data counters.
Checkpoint data counters .
def load_data_counters(output_dir, host_id=None):
  """Checkpoint data counters."""
  global data_counters
  host_id = jax.process_index() if host_id is None else host_id
  fname = os.path.join(output_dir, 'data_counters%d.pkl' % host_id)
  if not tf.io.gfile.exists(fname):
    logging.info('Did not load data counters as %s does not exist.', fname)
    return
  with tf.io.gfile.GFile(fname, 'rb') as f:
    obj = pickle.load(f)
  data_counters = obj
def load_data_counters ( output_dir , host_id = None ) : global data_counters host_id = jax . process_index ( ) if host_id is None else host_id fname = os . path . join ( output_dir , 'data_counters%d.pkl' % host_id ) if not tf . io . gfile . exists ( fname ) : logging . info ( 'Did not load data counters as %s does not exist.' , fname ) return with tf . io . gfile . GFile ( fname , 'rb' ) as f : obj = pickle . load ( f ) data_counters = obj