code: def _kernel_distance(
      squared_distances: torch.Tensor, eps: float = 1e-8
  ) -> torch.Tensor:
      r"""Compute the TPS kernel distance function: :math:`r^2 log(r)`, where `r` is the euclidean distance.
  
      Since
      :math: `\log(r) = 1/2 \log(r^2)`, this function takes the squared distance matrix and calculates
      :math: `0.5 r^2 log(r^2)`.
      """
      # r^2 * log(r) = 1/2 * r^2 * log(r^2)
      return 0.5 * squared_distances * squared_distances.add(eps).log()
  
file_path: kornia/kornia/geometry/transform/thin_plate_spline.py
imports: from __future__ import annotations
  import torch
  from torch import nn
  from kornia.core import ones, zeros
  from kornia.utils import create_meshgrid
  from kornia.utils.helpers import _torch_solve_cast
label_desc: Use image node_id 2 for calling a global function with example usage: _kernel_distance(squared_distances, eps) and returns: unknown