class_docstr: Accumulator for loss statistics.
  Currently calculates:
  
  * accuracy
  * perplexity
  * elapsed time
docstr: Gather a `Statistics` object accross multiple process/nodes
  
  Args:
      stat(:obj:Statistics): the statistics object to gather
          accross all processes/nodes
      max_size(int): max buffer size to use
  
  Returns:
      `Statistics`, the update stats object
docstr_tok: ["Gather","a","`","Statistics","`","object","accross","multiple","process\/nodes","Args",":","stat","(",":","obj",":","Statistics",")",":","the","statistics","object","to","gather","accross","all","processes\/nodes","max_size","(","int",")",":","max","buffer","size","to","use","Returns",":","`","Statistics","`",",","the","update","stats","object"]
code: def all_gather_stats(stat, max_size=4096):
      """
      Gather a `Statistics` object accross multiple process/nodes
  
      Args:
          stat(:obj:Statistics): the statistics object to gather
              accross all processes/nodes
          max_size(int): max buffer size to use
  
      Returns:
          `Statistics`, the update stats object
      """
      stats = Statistics.all_gather_stats_list(
          [stat], max_size=max_size
      )
      return stats[0]
  
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 2 for calling the Statistics obj's underlying member method code with example usage: obj.all_gather_stats(stat, max_size) and returns: stats