class_docstr: This class implements the RecMetricComputation for AUPRC, i.e. Area Under the Curve.
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
  Args:
      grouped_auprc (bool): If True, computes AUPRC per group and returns average AUPRC across all groups.
          The `grouping_keys` is provided during state updates along with predictions, labels, weights.
          This feature is currently not enabled for `fused_update_limit`.
code: def __init__(
      self,
      *args: Any,
      grouped_auprc: bool = False,
      fused_update_limit: int = 0,
      **kwargs: Any,
  ) -> None:
      super().__init__(*args, **kwargs)
      if grouped_auprc and fused_update_limit > 0:
          raise RecMetricException(
              "Grouped AUPRC and Fused Update Limit cannot be enabled together yet."
          )
  
      self._grouped_auprc: bool = grouped_auprc
      self._add_state(
          PREDICTIONS,
          [],
          add_window_state=False,
          dist_reduce_fx=_state_reduction,
          persistent=False,
      )
      self._add_state(
          LABELS,
          [],
          add_window_state=False,
          dist_reduce_fx=_state_reduction,
          persistent=False,
      )
      self._add_state(
          WEIGHTS,
          [],
          add_window_state=False,
          dist_reduce_fx=_state_reduction,
          persistent=False,
      )
      if self._grouped_auprc:
          self._add_state(
              GROUPING_KEYS,
              [],
              add_window_state=False,
              dist_reduce_fx=_grouping_keys_state_reduction,
              persistent=False,
          )
      self._init_states()
  
imports: from functools import partial
  from typing import Any, cast, Dict, List, Optional, Type
  import torch
  import torch.distributed
  import torch.nn.functional
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  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 to create a new AUPRCMetricComputation object from inherited base classes: RecMetricComputation with example: obj = AUPRCMetricComputation()