code: def getCosAffinityMatrix(emb: torch.Tensor) -> torch.Tensor:
      """
      Calculate cosine similarity values among speaker embeddings then min-max normalize
      the affinity matrix.
  
      Args:
          emb (Tensor):
              Matrix containing embedding vectors. emb variable should be float(FP32) type to make the data-type
              compatible with torch.mm operation for both CPU and GPU(CUDA).
              dimension: (Number of embedding vectors) x (embedding dimension)
  
      Returns:
          sim_d (Tensor):
              Matrix containing cosine similarity values among the given embedding vectors.
              dimension: (Number of embedding vectors) x (Number of embedding vectors)
      """
      if emb.shape[0] == 1:
          sim_d = torch.tensor([[1]]).to(emb.device)
      else:
          emb = emb.float()
          sim_d = cos_similarity(emb, emb)
          sim_d = ScalerMinMax(sim_d)
      return sim_d
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 13 for calling a global function with example usage: getCosAffinityMatrix(emb) and returns: sim_d