code: def _prepare_output(
      self, output: Sequence[torch.Tensor]
  ) -> Sequence[torch.Tensor]:
      y_pred, y = output[0].detach(), output[1].detach()
  
      if self._type == "binary" or self._type == "multiclass":
          num_classes = 2 if self._type == "binary" else y_pred.size(1)
          if self._type == "multiclass" and y.max() + 1 > num_classes:
              raise ValueError(
                  f"y_pred contains fewer classes than y. Number of classes in the prediction is {num_classes}"
                  f" and an element in y has invalid class = {y.max().item() + 1}."
              )
          y = y.view(-1)
          if self._type == "binary" and self._average is False:
              y_pred = y_pred.view(-1)
          else:
              y = to_onehot(y.long(), num_classes=num_classes)
              indices = (
                  torch.argmax(y_pred, dim=1)
                  if self._type == "multiclass"
                  else y_pred.long()
              )
              y_pred = to_onehot(
                  indices.view(-1), num_classes=num_classes
              )
      elif self._type == "multilabel":
          # if y, y_pred shape is (N, C, ...) -> (N * ..., C)
          num_labels = y_pred.size(1)
          y_pred = torch.transpose(y_pred, 1, -1).reshape(
              -1, num_labels
          )
          y = torch.transpose(y, 1, -1).reshape(-1, num_labels)
  
      # Convert from int cuda/cpu to double on self._device
      y_pred = y_pred.to(dtype=torch.float64, device=self._device)
      y = y.to(dtype=torch.float64, device=self._device)
      correct = y * y_pred
  
      return y_pred, y, correct
  
file_path: ignite/ignite/metrics/precision.py
imports: import warnings
  from typing import Callable, cast, Optional, Sequence, Union
  import torch
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics.accuracy import _BaseClassification
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
  from ignite.utils import to_onehot
label_desc: Use image node_id 3 for calling the _BasePrecisionRecall obj's underlying member method code with example usage: obj._prepare_output(output) and returns: y_pred,  y,  correct