code: def _multilabel_exact_match_update(
      preds: Tensor,
      target: Tensor,
      num_labels: int,
      multidim_average: Literal["global", "samplewise"] = "global",
  ) -> Tuple[Tensor, Tensor]:
      """Compute the statistics."""
      if multidim_average == "global":
          preds = torch.movedim(preds, 1, -1).reshape(-1, num_labels)
          target = torch.movedim(target, 1, -1).reshape(-1, num_labels)
  
      correct = ((preds == target).sum(1) == num_labels).sum(dim=-1)
      total = torch.tensor(
          preds.shape[0 if multidim_average == "global" else 2],
          device=correct.device,
      )
      return correct, total
  
file_path: torchmetrics/src/torchmetrics/functional/classification/exact_match.py
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.stat_scores import _multiclass_stat_scores_arg_validation, _multiclass_stat_scores_format, _multiclass_stat_scores_tensor_validation, _multilabel_stat_scores_arg_validation, _multilabel_stat_scores_format, _multilabel_stat_scores_tensor_validation
  from torchmetrics.utilities.compute import _safe_divide
  from torchmetrics.utilities.enums import ClassificationTaskNoBinary
label_desc: Use image node_id 4 for calling a global function with example usage: _multilabel_exact_match_update(preds, target, num_labels, multidim_average) and returns: correct,  total