code: def merge_vectors(
      selected_inds: torch.Tensor,
      emb_ndx: torch.Tensor,
      pre_cluster_labels: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Merge feature (embedding) vectors estimated to be the same cluster label.
  
      Args:
          selected_inds (Tensor):
              Selected indices for merging
          emb_ndx (Tensor):
              Feature (embedding) vectors
              Dimension: (original vector counts) x (feature dimension)
          pre_cluster_labels (Tensor):
              Original cluster labels before merging
  
      Returns:
          merged_vecs (Tensor):
              Merged feature vectors that are concatenated
              Dimension: (merged vector counts) x (feature dimension)
          merged_clus_labels (Tensor):
              Cluster labels for the merged feature vectors
              Dimension: (merged vector counts)
      """
      if emb_ndx.shape[0] != pre_cluster_labels.shape[0]:
          raise ValueError(
              "pre_cluster_labels and emb_ndx have mismatch in dimension"
          )
      avg_emb = torch.mean(emb_ndx[selected_inds, :], dim=0)
      merged_clus_labels = pre_cluster_labels[selected_inds]
      selected_inds_list: List[int] = selected_inds.tolist()
      bypass_inds_list: List[int] = []
      for k in range(emb_ndx.shape[0]):
          if k not in selected_inds_list:
              bypass_inds_list.append(k)
      bypass_inds = torch.tensor(bypass_inds_list)
      selected_inds = torch.tensor(selected_inds_list)
      if bypass_inds.shape[0] == 0:
          merged_vecs = avg_emb.unsqueeze(0)
          merged_clus_labels = merged_clus_labels.unsqueeze(0)
      else:
          merged_vecs = torch.vstack((emb_ndx[bypass_inds], avg_emb))
          merged_clus_labels = torch.hstack(
              (pre_cluster_labels[bypass_inds], merged_clus_labels[0])
          )
      return merged_vecs, merged_clus_labels
  
imports: from typing import List, Tuple
  import torch
  from nemo.collections.asr.parts.utils.offline_clustering import NMESC, SpeakerClustering, SpectralClustering, get_scale_interpolated_embs, getAffinityGraphMat, getCosAffinityMatrix, split_input_data
  from nemo.collections.asr.parts.utils.optimization_utils import linear_sum_assignment
label_desc: Use image node_id 6 for calling a global function with example usage: merge_vectors(selected_inds, emb_ndx, pre_cluster_labels) and returns: merged_vecs,  merged_clus_labels