code: def _multiclass_calibration_error_update(
      preds: Tensor,
      target: Tensor,
  ) -> Tuple[Tensor, Tensor]:
      if not torch.all((preds >= 0) * (preds <= 1)):
          preds = preds.softmax(1)
      confidences, predictions = preds.max(dim=1)
      accuracies = predictions.eq(target)
      return confidences.float(), accuracies.float()
  
file_path: torchmetrics/src/torchmetrics/functional/classification/calibration_error.py
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.confusion_matrix import _binary_confusion_matrix_format, _binary_confusion_matrix_tensor_validation, _multiclass_confusion_matrix_format, _multiclass_confusion_matrix_tensor_validation
  from torchmetrics.utilities.enums import ClassificationTaskNoMultilabel
label_desc: Use image node_id 9 for calling a global function with example usage: _multiclass_calibration_error_update(preds, target) and returns: confidences,  accuracies