class_docstr: Accumulator for loss statistics.
  Currently calculates:
  
  * accuracy
  * perplexity
  * elapsed time
docstr: Update statistics by suming values with another `Statistics` object
  
  Args:
      stat: another statistic object
      update_n_src_words(bool): whether to update (sum) `n_src_words`
          or not
docstr_tok: ["Update","statistics","by","suming","values","with","another","`","Statistics","`","object","Args",":","stat",":","another","statistic","object","update_n_src_words","(","bool",")",":","whether","to","update","(","sum",")","`","n_src_words","`","or","not"]
code: def update(self, stat, update_n_src_words=False):
      """
      Update statistics by suming values with another `Statistics` object
  
      Args:
          stat: another statistic object
          update_n_src_words(bool): whether to update (sum) `n_src_words`
              or not
  
      """
      self.loss += stat.loss
      self.n_batchs += stat.n_batchs
      self.n_sents += stat.n_sents
      self.n_words += stat.n_words
      self.n_correct += stat.n_correct
      self.computed_metrics = stat.computed_metrics
  
      if update_n_src_words:
          self.n_src_words += stat.n_src_words
  
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 4 for calling the Statistics obj's underlying member method code with example usage: obj.update(stat, update_n_src_words) without return types