code: def cosine_distance(x: Tensor, y: Tensor) -> np.ndarray:
      """compute the cosine distance.
  
      Args:
          x (Tensor): embeddings with shape (N,C).
          y (Tensor): embeddings with shape (M,C).
  
      Returns:
          ndarray: cosine distance with shape (N,M).
      """
      x = x.cpu().numpy()
      y = y.cpu().numpy()
      x = x / np.linalg.norm(x, axis=1, keepdims=True)
      y = y / np.linalg.norm(y, axis=1, keepdims=True)
      dists = 1.0 - np.dot(x, y.T)
      return dists
  
file_path: mmdetection/mmdet/models/trackers/strongsort_tracker.py
imports: from typing import Optional, Tuple
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.utils import imrenormalize
  from mmdet.registry import MODELS
  from mmdet.structures import TrackDataSample
  from mmdet.structures.bbox import bbox_overlaps, bbox_xyxy_to_cxcyah
  from mmdet.utils import OptConfigType
  from .sort_tracker import SORTTracker
label_desc: Use image node_id 1 for calling a global function with example usage: cosine_distance(x, y) and returns: dists