code: def compute_cross_entropy(
      labels: torch.Tensor,
      predictions: torch.Tensor,
      weights: torch.Tensor,
      eta: float,
  ) -> torch.Tensor:
      predictions = predictions.double()
      predictions.clamp_(min=eta, max=1 - eta)
      cross_entropy = -weights * labels * torch.log2(
          predictions
      ) - weights * (1.0 - labels) * torch.log2(1.0 - predictions)
      return cross_entropy
  
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 1 for calling a global function with example usage: compute_cross_entropy(labels, predictions, weights, eta) and returns: cross_entropy