class_docstr: Provides metrics for the number of examples processed per second.
  
  Examples:
      For more information on how metric works with :class:`~ignite.engine.engine.Engine`, visit :ref:`attach-engine`.
  
      .. code-block:: python
  
          # Compute number of tokens processed
          wps_metric = Frequency(output_transform=lambda x: x['ntokens'])
          wps_metric.attach(trainer, name='wps')
          # Logging with TQDM
          ProgressBar(persist=True).attach(trainer, metric_names=['wps'])
          # Progress bar will look like
          # Epoch [2/10]: [12/24]  50%|█████      , wps=400 [00:17<1:23]
  
  
      To compute examples processed per second every 50th iteration:
  
      .. code-block:: python
  
          # Compute number of tokens processed
          wps_metric = Frequency(output_transform=lambda x: x['ntokens'])
          wps_metric.attach(trainer, name='wps', event_name=Events.ITERATION_COMPLETED(every=50))
          # Logging with TQDM
          ProgressBar(persist=True).attach(trainer, metric_names=['wps'])
          # Progress bar will look like
          # Epoch [2/10]: [50/100]  50%|█████      , wps=400 [00:17<00:35]
code: def compute(self) -> float:
      time_divisor = 1.0
  
      if idist.get_world_size() > 1:
          time_divisor *= idist.get_world_size()
  
      # Returns the average processed objects per second across all workers
      return self._n / self._elapsed * time_divisor
  
file_path: ignite/ignite/metrics/frequency.py
imports: from typing import Callable, Union
  import torch
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.handlers.timing import Timer
  from ignite.metrics.metric import Metric, reinit__is_reduced, sync_all_reduce
label_desc: Use image node_id 4 for calling the Frequency obj's underlying member method code with example usage: obj.compute() and returns: unknown