class_docstr: Computes throughput.
  
  +------------------------+-------------------------------------------------------------------------------------+
  | Key                    | Value                                                                               |
  +========================+=====================================================================================+
  | batches_per_sec        | Rolling average (over ``window_size`` most recent updates) of the number of batches |
  |                        | processed per second                                                                |
  +--------------------------+-----------------------------------------------------------------------------------+
  | samples_per_sec        | Rolling average (over ``window_size`` most recent updates) of the number of samples |
  |                        | processed per second                                                                |
  +--------------------------+-----------------------------------------------------------------------------------+
  | items_per_sec          | Rolling average (over ``window_size`` most recent updates) of the number of items   |
  |                        | processed per second                                                                |
  +--------------------------+-----------------------------------------------------------------------------------+
  | flpps_per_sec          | Rolling average (over ``window_size`` most recent updates) of the number of flops   |
  |                        | processed per second                                                                |
  +--------------------------+-----------------------------------------------------------------------------------+
  | device/batches_per_sec | batches_per_sec divided by world size                                               |
  +--------------------------+-----------------------------------------------------------------------------------+
  | device/samples_per_sec | samples_per_sec divided by world size                                               |
  +--------------------------+-----------------------------------------------------------------------------------+
  | device/items_per_sec   | items_per_sec divided by world size. This may include padding depending on the data |
  +--------------------------+-----------------------------------------------------------------------------------+
  | device/flops_per_sec   | flops_per_sec divided by world size.                                                |
  +--------------------------+-----------------------------------------------------------------------------------+
  | device/mfu             | device/flops_per_sec divided by world size.                                         |
  +--------------------------+-----------------------------------------------------------------------------------+
  | time                   | Total elapsed time                                                                  |
  +--------------------------+-----------------------------------------------------------------------------------+
  | batches                | Total batches seen                                                                  |
  +--------------------------+-----------------------------------------------------------------------------------+
  | samples                | Total samples seen                                                                  |
  +--------------------------+-----------------------------------------------------------------------------------+
  | lengths                | Total items seen                                                                    |
  +--------------------------+-----------------------------------------------------------------------------------+
  
  Example::
  
      throughput = Throughput()
      t0 = time()
      for i in range(1000):
          do_work()
          if torch.cuda.is_available(): torch.cuda.synchronize()  # required or else time() won't be correct
          throughput.update(time=time() - t0, samples=i)
          if i % 10 == 0:
              print(throughput.compute())
  
  Notes:
      - The implementation assumes that devices FLOPs are all the same as it normalizes by the world size and only
        takes a single ``available_flops`` value.
      - items_per_sec, flops_per_sec and MFU do not account for padding if present. We suggest using
        samples_per_sec or batches_per_sec to measure throughput under this circumstance.
  
  Args:
      available_flops: Number of theoretical flops available for a single device.
      world_size: Number of devices available across hosts. Global metrics are not included if the world size is 1.
      window_size: Number of batches to use for a rolling average.
      separator: Key separator to use when creating per-device and global metrics.
code: def reset(self) -> None:
      self._time.clear()
      self._batches.clear()
      self._samples.clear()
      self._lengths.clear()
      self._flops.clear()
  
imports: from collections import deque
  from typing import TYPE_CHECKING, Any, Callable, Deque, Dict, List, Optional, TypeVar, Union
  import torch
  from typing_extensions import override
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from lightning.fabric.utilities.rank_zero import rank_zero_only, rank_zero_warn
label_desc: Use image node_id 4 for calling the Throughput obj's underlying member method code with example usage: obj.reset() without return types