code: def _check_Q_matrix(Q_matrix: Tensor) -> None:
      r"""Utility function to ensure Q matrix is of correct form.
  
      Args:
          Q_matrix: The Q matrix for reprojecting disparity to a point cloud of shape :math:`(B, 4, 4)`
      """
      if not isinstance(Q_matrix, Tensor):
          raise StereoException(
              f"Expected 'Q_matrix' to be an instance of Tensor but got {type(Q_matrix)}."
          )
  
      if not len(Q_matrix.shape) == 3:
          raise StereoException(
              f"Expected 'Q_matrix' to have 3 dimensions. Got {Q_matrix.shape}"
          )
  
      if not Q_matrix.shape[1:] == (4, 4):
          raise StereoException(
              f"Expected last two dimensions of 'Q_matrix' to be of shape (4, 4). Got {Q_matrix.shape}"
          )
  
      if Q_matrix.dtype not in (
          torch.float16,
          torch.float32,
          torch.float64,
      ):
          raise StereoException(
              f"Expected 'Q_matrix' to be of type torch.float16, torch.float32 or torch.float64. Got {Q_matrix.dtype}"
          )
  
imports: from typing import Any
  import torch
  from kornia.core import Tensor, stack, zeros
  from kornia.geometry.linalg import transform_points
  from kornia.utils.grid import create_meshgrid
label_desc: Use image node_id 2 for calling a global function with example usage: _check_Q_matrix(Q_matrix) without return types