code: def compute_ne(
      ce_sum: torch.Tensor,
      weighted_num_samples: torch.Tensor,
      pos_labels: torch.Tensor,
      neg_labels: torch.Tensor,
      eta: float,
      allow_missing_label_with_zero_weight: bool = False,
  ) -> torch.Tensor:
      if (
          allow_missing_label_with_zero_weight
          and not weighted_num_samples.all()
      ):
          # If nan were to occur, return a dummy value instead of nan if
          # allow_missing_label_with_zero_weight is True
          return torch.tensor([eta])
  
      # Goes into this block if all elements in weighted_num_samples > 0
      mean_label = pos_labels / weighted_num_samples
      ce_norm = _compute_cross_entropy_norm(
          mean_label, pos_labels, neg_labels, eta
      )
      return ce_sum / ce_norm
  
file_path: torchrec/torchrec/metrics/ne.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, RecMetricException
label_desc: Use image node_id 3 for calling a global function with example usage: compute_ne(ce_sum, weighted_num_samples, pos_labels, neg_labels, eta, allow_missing_label_with_zero_weight) and returns: unknown, torch