class_docstr: Compute running average of a metric or the output of process function.
  
  Args:
      src: input source: an instance of :class:`~ignite.metrics.metric.Metric` or None. The latter
          corresponds to `engine.state.output` which holds the output of process function.
      alpha: running average decay factor, default 0.98
      output_transform: a function to use to transform the output if `src` is None and
          corresponds the output of process function. Otherwise it should be None.
      epoch_bound: whether the running average should be reset after each epoch. It is depracated in favor of
          ``usage`` argument in :meth:`attach` method. Setting ``epoch_bound`` to ``False`` is equivalent to
          ``usage=SingleEpochRunningBatchWise()`` and setting it to ``True`` is equivalent to
          ``usage=RunningBatchWise()`` in the :meth:`attach` method. Default None.
      device: specifies which device updates are accumulated on. Should be
          None when ``src`` is an instance of :class:`~ignite.metrics.metric.Metric`, as the running average will
          use the ``src``'s device. Otherwise, defaults to CPU. Only applicable when the computed value
          from the metric is a tensor.
  
  Examples:
  
      For more information on how metric works with :class:`~ignite.engine.engine.Engine`, visit :ref:`attach-engine`.
  
      .. include:: defaults.rst
          :start-after: :orphan:
  
      .. testcode:: 1
  
          default_trainer = get_default_trainer()
  
          accuracy = Accuracy()
          metric = RunningAverage(accuracy)
          metric.attach(default_trainer, 'running_avg_accuracy')
  
          @default_trainer.on(Events.ITERATION_COMPLETED)
          def log_running_avg_metrics():
              print(default_trainer.state.metrics['running_avg_accuracy'])
  
          y_true = [torch.tensor(y) for y in [[0], [1], [0], [1], [0], [1]]]
          y_pred = [torch.tensor(y) for y in [[0], [0], [0], [1], [1], [1]]]
  
          state = default_trainer.run(zip(y_pred, y_true))
  
      .. testoutput:: 1
  
          1.0
          0.98
          0.98039...
          0.98079...
          0.96117...
          0.96195...
  
      .. testcode:: 2
  
          default_trainer = get_default_trainer()
  
          metric = RunningAverage(output_transform=lambda x: x.item())
          metric.attach(default_trainer, 'running_avg_accuracy')
  
          @default_trainer.on(Events.ITERATION_COMPLETED)
          def log_running_avg_metrics():
              print(default_trainer.state.metrics['running_avg_accuracy'])
  
          y = [torch.tensor(y) for y in [[0], [1], [0], [1], [0], [1]]]
  
          state = default_trainer.run(y)
  
      .. testoutput:: 2
  
          0.0
          0.020000...
          0.019600...
          0.039208...
          0.038423...
          0.057655...
code: def compute(self) -> Union[torch.Tensor, float]:
      return cast(Union[torch.Tensor, float], self._value)
  
file_path: ignite/ignite/metrics/running_average.py
imports: import warnings
  from typing import Any, Callable, cast, Optional, Union
  import torch
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.metrics.metric import Metric, MetricUsage, reinit__is_reduced, RunningBatchWise, SingleEpochRunningBatchWise
label_desc: Use image node_id 4 for calling the RunningAverage obj's underlying member method code with example usage: obj.compute() and returns: cast