code: def _compute(self) -> List[MetricComputationReport]:
      return [
          MetricComputationReport(
              name=MetricName.WEIGHTED_AVG,
              metric_prefix=MetricPrefix.LIFETIME,
              value=get_mean(
                  cast(torch.Tensor, self.weighted_sum),
                  cast(torch.Tensor, self.weighted_num_samples),
              ),
          ),
          MetricComputationReport(
              name=MetricName.WEIGHTED_AVG,
              metric_prefix=MetricPrefix.WINDOW,
              value=get_mean(
                  self.get_window_state("weighted_sum"),
                  self.get_window_state("weighted_num_samples"),
              ),
          ),
      ]
  
file_path: torchrec/torchrec/metrics/weighted_avg.py
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation
label_desc: Use image node_id 3 for calling the WeightedAvgMetricComputation obj's underlying member method code with example usage: obj._compute() and returns: list