code: def _validate_inputs(preds: Tensor, target: torch.Tensor) -> None:
      """Validate the shapes of prediction and target tensors.
  
      Args:
          preds: the prediction tensor
          target: the target tensor
  
      """
      if not isinstance(preds, Tensor):
          raise TypeError(
              f"Expected argument `preds` to be of type `torch.Tensor`, but got {type(preds)}"
          )
      if not isinstance(target, Tensor):
          raise TypeError(
              f"Expected argument `target` to be of type `torch.Tensor`, but got {type(target)}"
          )
      if preds.shape != target.shape:
          raise ValueError(
              f"Expected argument `preds` and `target` to have the same shape, but got {preds.shape} and {target.shape}"
          )
      if preds.dim() < 3:
          raise ValueError(
              "Expected argument `preds` to have at least one spatial dimension (B, *spatial_dims, 2), "
              f"got {preds.shape}"
          )
      if preds.shape[-1] != 2:
          raise ValueError(
              "Expected argument `preds` to have exactly 2 channels in the last dimension (category, instance), "
              f"got {preds.shape} instead"
          )
  
file_path: torchmetrics/src/torchmetrics/functional/detection/_panoptic_quality_common.py
imports: from typing import Collection, Dict, Iterator, List, Optional, Set, Tuple, cast
  import torch
  from torch import Tensor
  from torchmetrics.utilities import rank_zero_warn
label_desc: Use image node_id 5 for calling a global function with example usage: _validate_inputs(preds, target) without return types