code: def load_metrics(event_dir, epoch):
    
    metrics = {}
    for filename in tf.gfile.ListDirectory(event_dir):
      path = os.path.join(event_dir, filename)
      for event in tf.train.summary_iterator(path):
        if event.step == epoch and event.HasField("summary"):
          value = event.summary.value[0]
          metrics[value.tag] = value.simple_value
    return metrics
docs: Loads metrics for this epoch if they have already been written.
  
    This reads the entire event file but it's small with just per-epoch metrics.
  
    Args:
      event_dir: TODO(koz4k): Document this.
      epoch: TODO(koz4k): Document this.
  
    Returns:
      metrics.