code: def add_summaries(self, step, *tags_and_values):
      
      values = []
      to_print = []
      for tag, value in tags_and_values:
        values.append(tf.Summary.Value(tag=tag, simple_value=float(value)))
        to_print.append('%s=%g' % (tag, value))
      if self._summary_writer:
        summary = tf.Summary(value=values)
        event = tf.Event(wall_time=time.time(),
                         summary=summary,
                         step=int(step))
        self._summary_writer.add_event(event)
      print('[%d] %s' % (step, ', '.join(to_print)))
docs: Adds summaries to the writer and prints a log statement.