code: def _check_input(labels: np.ndarray, pred_probs: np.ndarray) -> None:
      """
      Checks that the input labels and predicted probabilities are valid.
  
      Parameters
      ----------
      labels:
          Array of shape ``(N, H, W)`` of integer labels, where `N` is the number of images in the dataset and `H` and `W` are the height and width of the images.
  
      pred_probs:
          Array of shape ``(N, K, H, W)`` of predicted probabilities, where `N` is the number of images in the dataset, `K` is the number of classes, and `H` and `W` are the height and width of the images.
      """
      if len(labels.shape) != 3:
          raise ValueError("labels must have a shape of (N, H, W)")
  
      if len(pred_probs.shape) != 4:
          raise ValueError(
              "pred_probs must have a shape of (N, K, H, W)"
          )
  
      num_images, height, width = labels.shape
      (
          num_images_pred,
          num_classes,
          height_pred,
          width_pred,
      ) = pred_probs.shape
  
      if (
          num_images != num_images_pred
          or height != height_pred
          or width != width_pred
      ):
          raise ValueError(
              "labels and pred_probs must have matching dimensions for N, H, and W"
          )
  
imports: from typing import Optional, List
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: _check_input(labels, pred_probs) without return types