code: def dist_matrix(
      d1: Tensor, d2: Tensor, is_normalized: bool = False
  ) -> Tensor:
      if is_normalized:
          return 2 - 2.0 * d1 @ d2.t()
      x_norm = (d1**2).sum(1).view(-1, 1)
      y_norm = (d2**2).sum(1).view(1, -1)
      # print(x_norm, y_norm)
      distmat = x_norm + y_norm - 2.0 * d1 @ d2.t()
      # distmat[torch.isnan(distmat)] = np.inf
      return distmat
  
file_path: kornia/kornia/feature/adalam/utils.py
imports: import math
  from typing import Tuple
  import torch
  from kornia.core import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: dist_matrix(d1, d2, is_normalized) and returns: distmat, unknown