class_docstr: This class implements the RecMetricComputation for Calibration, which is the
  ratio between the prediction and the labels (conversions).
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
class_docstr_tok: ["This","class","implements","the","RecMetricComputation","for","Calibration",",","which","is","the","ratio","between","the","prediction","and","the","labels","(","conversions",")",".","The","constructor","arguments","are","defined","in","RecMetricComputation",".","See","the","docstring","of","RecMetricComputation","for","more","detail","."]
code: def update(
      self,
      *,
      predictions: Optional[torch.Tensor],
      labels: torch.Tensor,
      weights: Optional[torch.Tensor],
      **kwargs: Dict[str, Any],
  ) -> None:
      if predictions is None or weights is None:
          raise RecMetricException(
              "Inputs 'predictions' and 'weights' should not be None for CalibrationMetricComputation update"
          )
      num_samples = predictions.shape[-1]
      for state_name, state_value in get_calibration_states(
          labels, predictions, weights
      ).items():
          state = getattr(self, state_name)
          state += state_value
          self._aggregate_window_state(
              state_name, state_value, num_samples
          )
  
file_path: torchrec/torchrec/metrics/calibration.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 2 for calling the CalibrationMetricComputation obj's underlying member method code with example usage: obj.update() without return types