class_docstr: This class implements the RecMetricComputation for tower QPS.
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
class_docstr_tok: ["This","class","implements","the","RecMetricComputation","for","tower","QPS",".","The","constructor","arguments","are","defined","in","RecMetricComputation",".","See","the","docstring","of","RecMetricComputation","for","more","detail","."]
code: def _compute(self) -> List[MetricComputationReport]:
      return [
          MetricComputationReport(
              name=MetricName.TOWER_QPS,
              metric_prefix=MetricPrefix.LIFETIME,
              value=_compute_tower_qps(
                  cast(torch.Tensor, self.num_examples)
                  - cast(torch.Tensor, self.warmup_examples),
                  cast(torch.Tensor, self.time_lapse),
              ),
          ),
          MetricComputationReport(
              name=MetricName.TOWER_QPS,
              metric_prefix=MetricPrefix.WINDOW,
              value=_compute_tower_qps(
                  self.get_window_state(NUM_EXAMPLES),
                  self.get_window_state(TIME_LAPSE),
              ),
          ),
          MetricComputationReport(
              name=MetricName.TOTAL_EXAMPLES,
              metric_prefix=MetricPrefix.DEFAULT,
              value=cast(torch.Tensor, self.num_examples).detach(),
          ),
      ]
  
file_path: torchrec/torchrec/metrics/tower_qps.py
imports: import time
  from typing import Any, cast, Dict, List, Optional, Type
  import torch
  import torch.distributed
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException, RecModelOutput
label_desc: Use image node_id 3 for calling the TowerQPSMetricComputation obj's underlying member method code with example usage: obj._compute() and returns: list