code: def square_distance(src, dst):
      """
      Calculate Euclid distance between each two points.
      src^T * dst = xn * xm + yn * ym + zn * zm；
      sum(src^2, dim=-1) = xn*xn + yn*yn + zn*zn;
      sum(dst^2, dim=-1) = xm*xm + ym*ym + zm*zm;
      dist = (xn - xm)^2 + (yn - ym)^2 + (zn - zm)^2
           = sum(src**2,dim=-1)+sum(dst**2,dim=-1)-2*src^T*dst
      Input:
          src: source points, [B, N, C]
          dst: target points, [B, M, C]
      Output:
          dist: per-point square distance, [B, N, M]
      """
      B, N, _ = src.shape
      _, M, _ = dst.shape
      dist = -2 * torch.matmul(src, dst.permute(0, 2, 1))
      dist += torch.sum(src**2, -1).view(B, N, 1)
      dist += torch.sum(dst**2, -1).view(B, 1, M)
      return dist
  
imports: from abc import ABC, abstractmethod
  import torch
  import torch.nn
  import torch.nn.functional
  import math
  from .multimodal_encoder.builder import build_vision_tower
  import pdb
  from ferret.constants import IGNORE_INDEX, IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_PATCH_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
label_desc: Use image node_id 6 for calling a global function with example usage: square_distance(src, dst) and returns: dist