class_docstr: Accumulator for loss statistics.
  Currently calculates:
  
  * accuracy
  * perplexity
  * elapsed time
docstr: display statistics to tensorboard
docstr_tok: ["display","statistics","to","tensorboard"]
code: def log_tensorboard(
      self, prefix, writer, learning_rate, patience, step
  ):
      """display statistics to tensorboard"""
      t = self.elapsed_time()
      writer.add_scalar(prefix + "/xent", self.xent(), step)
      writer.add_scalar(prefix + "/ppl", self.ppl(), step)
      for k, v in self.computed_metrics.items():
          writer.add_scalar(prefix + "/" + k, round(v, 4), step)
      writer.add_scalar(prefix + "/accuracy", self.accuracy(), step)
      writer.add_scalar(prefix + "/tgtper", self.n_words / t, step)
      writer.add_scalar(prefix + "/lr", learning_rate, step)
      if patience is not None:
          writer.add_scalar(prefix + "/patience", patience, step)
  
file_path: OpenNMT-py/onmt/utils/statistics.py
imports: import time
  import math
  import sys
  from onmt.utils.logging import logger
label_desc: Use image node_id 10 for calling the Statistics obj's underlying member method code with example usage: obj.log_tensorboard(prefix, writer, learning_rate, patience, step) without return types