code: def multiclass_confusion_matrix(
      preds: Tensor,
      target: Tensor,
      num_classes: int,
      normalize: Optional[
          Literal["true", "pred", "all", "none"]
      ] = None,
      ignore_index: Optional[int] = None,
      validate_args: bool = True,
  ) -> Tensor:
      r"""Compute the `confusion matrix`_ for multiclass tasks.
  
      Accepts the following input tensors:
  
      - ``preds``: ``(N, ...)`` (int tensor) or ``(N, C, ..)`` (float tensor). If preds is a floating point
        we apply ``torch.argmax`` along the ``C`` dimension to automatically convert probabilities/logits into
        an int tensor.
      - ``target`` (int tensor): ``(N, ...)``
  
      Additional dimension ``...`` will be flattened into the batch dimension.
  
      Args:
          preds: Tensor with predictions
          target: Tensor with true labels
          num_classes: Integer specifying the number of classes
          normalize: Normalization mode for confusion matrix. Choose from:
  
              - ``None`` or ``'none'``: no normalization (default)
              - ``'true'``: normalization over the targets (most commonly used)
              - ``'pred'``: normalization over the predictions
              - ``'all'``: normalization over the whole matrix
          ignore_index:
              Specifies a target value that is ignored and does not contribute to the metric calculation
          validate_args: bool indicating if input arguments and tensors should be validated for correctness.
              Set to ``False`` for faster computations.
  
      Returns:
          A ``[num_classes, num_classes]`` tensor
  
      Example (pred is integer tensor):
          >>> from torch import tensor
          >>> from torchmetrics.functional.classification import multiclass_confusion_matrix
          >>> target = tensor([2, 1, 0, 0])
          >>> preds = tensor([2, 1, 0, 1])
          >>> multiclass_confusion_matrix(preds, target, num_classes=3)
          tensor([[1, 1, 0],
                  [0, 1, 0],
                  [0, 0, 1]])
  
      Example (pred is float tensor):
          >>> from torchmetrics.functional.classification import multiclass_confusion_matrix
          >>> target = tensor([2, 1, 0, 0])
          >>> preds = tensor([[0.16, 0.26, 0.58],
          ...                 [0.22, 0.61, 0.17],
          ...                 [0.71, 0.09, 0.20],
          ...                 [0.05, 0.82, 0.13]])
          >>> multiclass_confusion_matrix(preds, target, num_classes=3)
          tensor([[1, 1, 0],
                  [0, 1, 0],
                  [0, 0, 1]])
  
      """
      if validate_args:
          _multiclass_confusion_matrix_arg_validation(
              num_classes, ignore_index, normalize
          )
          _multiclass_confusion_matrix_tensor_validation(
              preds, target, num_classes, ignore_index
          )
      preds, target = _multiclass_confusion_matrix_format(
          preds, target, ignore_index
      )
      confmat = _multiclass_confusion_matrix_update(
          preds, target, num_classes
      )
      return _multiclass_confusion_matrix_compute(confmat, normalize)
  
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.utilities.checks import _check_same_shape
  from torchmetrics.utilities.data import _bincount
  from torchmetrics.utilities.enums import ClassificationTask
  from torchmetrics.utilities.prints import rank_zero_warn
label_desc: Use image node_id 13 for calling a global function with example usage: multiclass_confusion_matrix(preds, target, num_classes, normalize, ignore_index, validate_args) and returns: _multiclass_confusion_matrix_compute