code: def _panoptic_quality_compute(
      iou_sum: Tensor,
      true_positives: Tensor,
      false_positives: Tensor,
      false_negatives: Tensor,
  ) -> Tensor:
      """Compute the final panoptic quality from interim values.
  
      Args:
          iou_sum: the iou sum from the update step
          true_positives: the TP value from the update step
          false_positives: the FP value from the update step
          false_negatives: the FN value from the update step
  
      Returns:
          Panoptic quality as a tensor containing a single scalar.
  
      """
      # per category calculation
      denominator = (
          true_positives + 0.5 * false_positives + 0.5 * false_negatives
      ).double()
      panoptic_quality = torch.where(
          denominator > 0.0, iou_sum / denominator, 0.0
      )
      # Reduce across categories. TODO: is it useful to have the option of returning per class metrics?
      return torch.mean(panoptic_quality[denominator > 0])
  
file_path: torchmetrics/src/torchmetrics/functional/detection/_panoptic_quality_common.py
imports: from typing import Collection, Dict, Iterator, List, Optional, Set, Tuple, cast
  import torch
  from torch import Tensor
  from torchmetrics.utilities import rank_zero_warn
label_desc: Use image node_id 15 for calling a global function with example usage: _panoptic_quality_compute(iou_sum, true_positives, false_positives, false_negatives) and returns: torch