class_docstr: Manages reporting of metrics.
class_docstr_tok: ["Manages","reporting","of","metrics","."]
code: def report(self, stdout=None):
      if self._last_step % self._log_interval == 0:
  
          def smooth(values):
              return (sum(values) / len(values)) if values else 0.0
  
          metrics = ",".join(
              [
                  "%s = %.5f" % (k, smooth(v))
                  for k, v in six.iteritems(self._metrics)
              ]
          )
          if self._last_reported_time:
              elapsed_secs = time.time() - self._last_reported_time
              metrics += " (%.3f sec)" % elapsed_secs
              if self._writer:
                  elapsed_steps = float(
                      self._last_step - self._last_reported_step
                  )
                  self._writer.add(
                      self._last_step,
                      "step/sec",
                      elapsed_steps / elapsed_secs,
                  )
  
          line = "Step {}: {}".format(self._last_step, metrics)
          if stdout:
              stdout.write(line)
          else:
              print(line)
  
          self._last_reported_time = time.time()
          self._last_reported_step = self._last_step
  
file_path: studio/studio/torch/summary.py
imports: import collections
  import six
  import time
label_desc: Use image node_id 4 for calling the Reporter obj's underlying member method code with example usage: obj.report(stdout) and returns: unknown