code: def _compute(states: Dict[str, torch.Tensor]) -> torch.Tensor:
      allow_missing_label_with_zero_weight = False
      if not states["weighted_num_samples"].all():
          allow_missing_label_with_zero_weight = True
  
      return compute_ne(
          states["cross_entropy_sum"],
          states["weighted_num_samples"],
          pos_labels=states["pos_labels"],
          neg_labels=states["neg_labels"],
          eta=TestNEMetric.eta,
          allow_missing_label_with_zero_weight=allow_missing_label_with_zero_weight,
      )
  
imports: import unittest
  from functools import partial, update_wrapper
  from typing import Callable, Dict, Type
  import torch
  from torchrec.metrics.ne import compute_cross_entropy, compute_logloss, compute_ne, NEMetric
  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 2 for calling the TestNEMetric obj's underlying member method code with example usage: obj._compute(states) and returns: compute_ne