code: def generate_model_outputs_cases() -> (
      Iterable[Dict[str, Optional[torch.Tensor]]]
  ):
      return [
          # random_inputs
          {
              "labels": torch.tensor([[1, 0, 0, 1, 1]]),
              "predictions": torch.tensor([[0.2, 0.6, 0.8, 0.4, 0.9]]),
              "weights": torch.tensor([[0.1, 0.1, 0.1, 0.1, 0.6]]),
              "expected_weighted_avg": torch.tensor([0.74]),
          },
          # no weight
          {
              "labels": torch.tensor([[1, 0, 1, 0, 1, 0]]),
              "predictions": torch.tensor([[0.5] * 6]),
              "weights": None,
              "expected_weighted_avg": torch.tensor([0.5]),
          },
          # all weights are zero
          {
              "labels": torch.tensor([[1, 1, 1, 1, 1]]),
              "predictions": torch.tensor([[0.2, 0.6, 0.8, 0.4, 0.9]]),
              "weights": torch.tensor([[0] * 5]),
              "expected_weighted_avg": torch.tensor([float("nan")]),
          },
      ]
  
file_path: torchrec/torchrec/metrics/tests/test_weighted_avg.py
imports: import unittest
  from typing import Dict, Iterable, Optional, Type, Union
  import torch
  from torchrec.metrics.rec_metric import RecComputeMode, RecMetric, RecTaskInfo
  from torchrec.metrics.test_utils import metric_test_helper, rec_metric_value_test_launcher, TestMetric
  from torchrec.metrics.weighted_avg import get_mean, WeightedAvgMetric
label_desc: Use image node_id 1 for calling a global function with example usage: generate_model_outputs_cases() and returns: list