code: def KORNIA_CHECK_DM_DESC(
      desc1: Tensor, desc2: Tensor, dm: Tensor, raises: bool = True
  ) -> bool:
      """Check whether the provided descriptors match with a distance matrix.
  
      Args:
          desc1: first descriptor tensor to evaluate.
          desc2: second descriptor tensor to evaluate.
          dm: distance matrix tensor to evaluate.
          raises: bool indicating whether an exception should be raised upon failure.
  
      Raises:
          TypeException: if the descriptors shape do not match with the distance matrix and raises is True.
  
      Example:
          >>> desc1 = torch.rand(4)
          >>> desc2 = torch.rand(8)
          >>> dm = torch.rand(4, 8)
          >>> KORNIA_CHECK_DM_DESC(desc1, desc2, dm)
          True
      """
      if not (
          (dm.size(0) == desc1.size(0))
          and (dm.size(1) == desc2.size(0))
      ):
          if raises:
              raise TypeError(
                  f"distance matrix shape {dm.shape} is not onsistent with descriptors shape: desc1 {desc1.shape} "
                  f"desc2 {desc2.shape}"
              )
          return False
      return True
  
imports: from __future__ import annotations
  from typing import Any, Optional, Sequence, TypeVar, cast
  from torch import float16, float32, float64
  from typing_extensions import TypeGuard
  from kornia.core import Tensor
label_desc: Use image node_id 14 for calling a global function with example usage: KORNIA_CHECK_DM_DESC(desc1, desc2, dm, raises) and returns: True, False