class_docstr: Object to which observed values are reported.
  
  Reporter is used to collect values that users want to watch. The reporter
  object holds a mapping from value names to the actually observed values.
  We call this mapping `observations`.
  
  When a value is passed to the reporter, an object called `observer` can be
  optionally attached. In this case, the name of the observer is added as the
  prefix of the value name. The observer name should be registered
  beforehand.
  
  See the following example:
  
  >>> from chainer import Reporter, report, report_scope
  >>>
  >>> reporter = Reporter()
  >>> observer = object()  # it can be an arbitrary (reference) object
  >>> reporter.add_observer('my_observer', observer)
  >>> observation = {}
  >>> with reporter.scope(observation):
  ...     reporter.report({'x': 1}, observer)
  ...
  >>> observation
  {'my_observer/x': 1}
  
  There are also a global API to add values:
  
  >>> reporter = Reporter()
  >>> observation = {}
  >>> with reporter:
  ...     with report_scope(observation):
  ...         report({'x': 1})
  ...
  >>> observation
  {'x': 1}
  
  The most important application of Reporter is to report observed values
  from each link or chain in the training and validation procedures.
  :class:`~chainer.training.Trainer` and some extensions prepare their own
  Reporter object with the hierarchy of the target link registered as
  observers. We can use :func:`report` function inside any links and chains
  to report the observed values (e.g., training loss, accuracy, activation
  statistics, etc.).
  
  Attributes:
      observation: Dictionary of observed values.
class_docstr_tok: ["Object","to","which","observed","values","are","reported",".","Reporter","is","used","to","collect","values","that","users","want","to","watch",".","The","reporter","object","holds","a","mapping","from","value","names","to","the","actually","observed","values",".","We","call","this","mapping","`","observations","`",".","When","a","value","is","passed","to","the","reporter",",","an","object","called","`","observer","`","can","be","optionally","attached",".","In","this","case",",","the","name","of","the","observer","is","added","as","the","prefix","of","the","value","name",".","The","observer","name","should","be","registered","beforehand",".","See","the","following","example",":",">",">",">","from","chainer","import","Reporter",",","report",",","report_scope",">",">",">",">",">",">","reporter","=","Reporter","(",")",">",">",">","observer","=","object","(",")","#","it","can","be","an","arbitrary","(","reference",")","object",">",">",">","reporter.add_observer","(","'my_observer","'",",","observer",")",">",">",">","observation","=","{","}",">",">",">","with","reporter.scope","(","observation",")",":","...","reporter.report","(","{","'","x","'",":","1","}",",","observer",")","...",">",">",">","observation","{","'my_observer\/x","'",":","1","}","There","are","also","a","global","API","to","add","values",":",">",">",">","reporter","=","Reporter","(",")",">",">",">","observation","=","{","}",">",">",">","with","reporter",":","...","with","report_scope","(","observation",")",":","...","report","(","{","'","x","'",":","1","}",")","...",">",">",">","observation","{","'","x","'",":","1","}","The","most","important","application","of","Reporter","is","to","report","observed","values","from","each","link","or","chain","in","the","training","and","validation","procedures",".",":","class",":","`","~chainer.training.Trainer","`","and","some","extensions","prepare","their","own","Reporter","object","with","the","hierarchy","of","the","target","link","registered","as","observers",".","We","can","use",":","func",":","`","report","`","function","inside","any","links","and","chains","to","report","the","observed","values","(","e.g.",",","training","loss",",","accuracy",",","activation","statistics",",","etc.",")",".","Attributes",":","observation",":","Dictionary","of","observed","values","."]
docstr: Creates a scope to report observed values to ``observation``.
  
  This is a context manager to be passed to ``with`` statements. In this
  scope, the observation dictionary is changed to the given one.
  
  It also makes this reporter object current.
  
  Args:
      observation (dict): Observation dictionary. All observations
          reported inside of the ``with`` statement are written to this
          dictionary.
code: def scope(self, observation):
      """Creates a scope to report observed values to ``observation``.
  
      This is a context manager to be passed to ``with`` statements. In this
      scope, the observation dictionary is changed to the given one.
  
      It also makes this reporter object current.
  
      Args:
          observation (dict): Observation dictionary. All observations
              reported inside of the ``with`` statement are written to this
              dictionary.
  
      """
      old = self.observation
      self.observation = observation
      self.__enter__()
      try:
          yield
      finally:
          self.__exit__(None, None, None)
          self.observation = old
  
imports: from __future__ import absolute_import
  import collections
  import contextlib
  import copy
  import json
  import threading
  import typing
  import warnings
  import numpy
  import six
  import chainer
  from chainer import backend
  from chainer import configuration
  from chainer import serializer
  from chainer import variable
  import chainerx
label_desc: Use image node_id 4 for calling the Reporter obj's underlying member method code with example usage: obj.scope(observation) without return types