def add_mean_metric(name, values, eval_metric_ops):
  """Add the mean of the values Tensor as a metric."""
  if eval_metric_ops is not None:
    v, u = tf.metrics.mean(values)
    # This line is required to make the statistics show up on Tensorboard.
    tf.summary.scalar(name, v)
    eval_metric_ops[name] = (v, u)
Add the mean of the values Tensor as a metric.
language/realm/model.py