code: def _get_states(
      labels: torch.Tensor,
      predictions: torch.Tensor,
      weights: torch.Tensor,
  ) -> Dict[str, torch.Tensor]:
      predictions = predictions.double()
      accuracy_sum = torch.sum(
          weights * ((predictions >= 0.5) == labels)
      )
      return {
          "accuracy_sum": accuracy_sum,
          "weighted_num_samples": torch.sum(weights),
      }
  
imports: import unittest
  from typing import Dict, Iterable, Type, Union
  import torch
  from torch import no_grad
  from torchrec.metrics.accuracy import AccuracyMetric, compute_accuracy
  from torchrec.metrics.metrics_config import DefaultTaskInfo
  from torchrec.metrics.rec_metric import RecComputeMode, RecMetric
  from torchrec.metrics.test_utils import metric_test_helper, rec_metric_value_test_launcher, RecTaskInfo, TestMetric
label_desc: Use image node_id 1 for calling the TestAccuracyMetric obj's underlying member method code with example usage: obj._get_states(labels, predictions, weights) and returns: dict