class_docstr: Generic multi-node evaluator for non-allreducable evaluation.
  
  This is to evaluate a Dataset that cannot evenly divided across
  all processes in the communicator, for evaluation calculation that
  is not applicable to a simple add-and-devide style averaging among
  processes.
  
  Users are recommeneded to implement its own local calculation
  ``calc_local()`` (e.g.  at each distributed GPU) and aggregation
  ``aggregate()`` of its results. Although it has built-in
  implementaiton of those two methods.
  
  It has several drawbacks; 1) Additional implementation of
  aggregation required to users, and 2) no compatibility with
  :class:`~chainer.training.extensions.Evaluator`.
  
  .. note:: No automatic support of Reporter is provided; Set it up
     at ``initialize()`` method
  
  Args:
      comm:
          ChainerMN communicator object
      iterator:
          An iterator for test dataset. Must be non-repeated.
      target (callable):
          A model to evaluate with test dataset
      device (int or chainer.backend.Device):
          A device indicator to send data with converter. Not used
          when the converter is not using any devices.
      converter (callable):
          A converter. Default value is
          :func:`chainer.dataset.concat_examples` .
      root (int):
          Rank number of root process to run bcast and gather with.
      progress_hook (callable):
          A callable that receives single argument for indicators. The
          callable is only callled at root process.
class_docstr_tok: ["Generic","multi-node","evaluator","for","non-allreducable","evaluation",".","This","is","to","evaluate","a","Dataset","that","can","not","evenly","divided","across","all","processes","in","the","communicator",",","for","evaluation","calculation","that","is","not","applicable","to","a","simple","add-and-devide","style","averaging","among","processes",".","Users","are","recommeneded","to","implement","its","own","local","calculation","``","calc_local","(",")","``","(","e.g",".","at","each","distributed","GPU",")","and","aggregation","``","aggregate","(",")","``","of","its","results",".","Although","it","has","built-in","implementaiton","of","those","two","methods",".","It","has","several","drawbacks",";","1",")","Additional","implementation","of","aggregation","required","to","users",",","and","2",")","no","compatibility","with",":","class",":","`","~chainer.training.extensions.Evaluator","`",".","..","note",":",":","No","automatic","support","of","Reporter","is","provided",";","Set","it","up","at","``","initialize","(",")","``","method","Args",":","comm",":","ChainerMN","communicator","object","iterator",":","An","iterator","for","test","dataset",".","Must","be","non-repeated",".","target","(","callable",")",":","A","model","to","evaluate","with","test","dataset","device","(","int","or","chainer.backend.Device",")",":","A","device","indicator","to","send","data","with","converter",".","Not","used","when","the","converter","is","not","using","any","devices",".","converter","(","callable",")",":","A","converter",".","Default","value","is",":","func",":","`","chainer.dataset.concat_examples","`",".","root","(","int",")",":","Rank","number","of","root","process","to","run","bcast","and","gather","with",".","progress_hook","(","callable",")",":","A","callable","that","receives","single","argument","for","indicators",".","The","callable","is","only","callled","at","root","process","."]
code: def __init__(
      self,
      comm,
      iterator,
      target,
      device=None,
      converter=convert.concat_examples,
      root=0,
      **kwargs,
  ):
      (progress_hook,) = argument.parse_kwargs(
          kwargs, ("progress_hook", None)
      )
  
      self.comm = comm
      self.iterator = iterator
      self._targets = {"main": target}
      self.converter = converter
  
      if device is not None:
          device = backend.get_device(device)
      self.device = device
  
      self._progress_hook = progress_hook
  
      assert 0 <= root and root < self.comm.size
      self.root = root
  
file_path: chainer/chainermn/extensions/multi_node_evaluator.py
imports: import copy
  import six
  from chainer.training import extension
  from chainer import backend
  from chainer.dataset import convert
  from chainer import function
  from chainer.utils import argument
  import chainerx
label_desc: Use image node_id 1 to create a new GenericMultiNodeEvaluator object from inherited base classes: extension with example: obj = GenericMultiNodeEvaluator(comm, iterator, target, device, converter, root)