docstr: Clustering method for speaker diarization based on cosine similarity.
  NME-SC part is converted to torch.tensor based operations in NeMo 1.9.
  
  Args:
      min_samples_for_nmesc (int):
          The minimum number of samples required for NME clustering. This avoids
          zero p_neighbour_lists. If the input has fewer segments than min_samples,
          it is directed to the enhanced speaker counting mode.
      nme_mat_size (int):
          The targeted matrix size for NME analysis.
      sparse_search (bool):
          Toggle sparse search mode. If True, limit the size of p_value_list to sparse_search_volume.
      maj_vote_spk_count (bool):
          If True, take a majority vote on all p-values in the given range to estimate the number of speakers.
          The majority voting may contribute to surpress overcounting of the speakers and improve speaker
          counting accuracy.
      parallelism (bool):
          Use dynamic parallelism feature in torch.jit compiler to accelerate the p-value search.
      cuda (bool):
          Boolean variable for toggling cuda availability.
code: def __init__(
      self,
      min_samples_for_nmesc: int = 6,
      nme_mat_size: int = 512,
      sparse_search: bool = True,
      maj_vote_spk_count: bool = False,
      parallelism: bool = False,
      cuda: bool = False,
  ):
      """
      Clustering method for speaker diarization based on cosine similarity.
      NME-SC part is converted to torch.tensor based operations in NeMo 1.9.
  
      Args:
          min_samples_for_nmesc (int):
              The minimum number of samples required for NME clustering. This avoids
              zero p_neighbour_lists. If the input has fewer segments than min_samples,
              it is directed to the enhanced speaker counting mode.
          nme_mat_size (int):
              The targeted matrix size for NME analysis.
          sparse_search (bool):
              Toggle sparse search mode. If True, limit the size of p_value_list to sparse_search_volume.
          maj_vote_spk_count (bool):
              If True, take a majority vote on all p-values in the given range to estimate the number of speakers.
              The majority voting may contribute to surpress overcounting of the speakers and improve speaker
              counting accuracy.
          parallelism (bool):
              Use dynamic parallelism feature in torch.jit compiler to accelerate the p-value search.
          cuda (bool):
              Boolean variable for toggling cuda availability.
      """
      super().__init__()
      self.min_samples_for_nmesc: int = min_samples_for_nmesc
      self.nme_mat_size: int = nme_mat_size
      self.sparse_search: bool = sparse_search
      self.parallelism: bool = parallelism
      self.cuda: bool = cuda
      self.maj_vote_spk_count: bool = maj_vote_spk_count
      self.embeddings_in_scales: List[torch.Tensor] = [torch.Tensor(0)]
      self.timestamps_in_scales: List[torch.Tensor] = [torch.Tensor(0)]
      self.device = (
          torch.device("cuda") if self.cuda else torch.device("cpu")
      )
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 1 to create a new SpeakerClustering object from inherited base classes: torch.nn with example: obj = SpeakerClustering(min_samples_for_nmesc, nme_mat_size, sparse_search, maj_vote_spk_count, parallelism, cuda)