code: def _get_states(
      labels: torch.Tensor,
      predictions: torch.Tensor,
      weights: torch.Tensor,
  ) -> Dict[str, torch.Tensor]:
      ctr_num = torch.sum(labels * weights)
      ctr_denom = torch.sum(weights)
      num_samples = torch.tensor(labels.size()[0]).double()
      return {
          "ctr_num": ctr_num,
          "ctr_denom": ctr_denom,
          "num_samples": num_samples,
      }
  
file_path: torchrec/torchrec/metrics/tests/test_ctr.py
imports: import unittest
  from typing import Dict, Type
  import torch
  from torchrec.metrics.ctr import CTRMetric
  from torchrec.metrics.rec_metric import RecComputeMode, RecMetric
  from torchrec.metrics.test_utils import metric_test_helper, rec_metric_value_test_launcher, TestMetric
label_desc: Use image node_id 1 for calling the TestCTRMetric obj's underlying member method code with example usage: obj._get_states(labels, predictions, weights) and returns: dict