def extract_scalars(multiplexer, run, tag):
  """Extract tabular data from the scalars at a given run and tag.
  The result is a list of 3-tuples (wall_time, step, value).
  """
  tensor_events = multiplexer.Tensors(run, tag)
  return [
     # (event.wall_time, event.step, tf.make_ndarray(event.tensor_proto).item())
      (event.wall_time, event.step, event.tensor_proto.float_val[0])
      for event in tensor_events
  ]