code: def get_scale_interpolated_embs(
      multiscale_weights: torch.Tensor,
      embeddings_in_scales: List[torch.Tensor],
      timestamps_in_scales: List[torch.Tensor],
      device: torch.device = torch.device("cpu"),
  ) -> Tuple[torch.Tensor, List[torch.Tensor]]:
      """
      Generate a scale-interpolated single embedding vector by calculating the weighted sum
      of the multiple embedding vectors from different scales. The output is a set of embedding
      vectors corresponding to the base-scale segments.
  
      Args:
          multiscale_weights (Tensor):
              Tensor containing Multiscale weights
              Dimensions: (Number of scales) x 1
          embeddings_in_scales (list):
              List containing split embedding tensors by each scale
          timestamps_in_scales (list):
              List containing split timestamps tensors by each scale
          device (torch.device):
              Torch device variable
  
      Returns:
          context_emb (Tensor):
              A set of scale-interpolated embedding vectors.
              Dimensions: (Number of base-scale segments) x (Dimensions of embedding vector)
          session_scale_mapping_list (list):
              List containing argmin arrays indexed by scale index.
      """
      rep_mat_list = []
      multiscale_weights = multiscale_weights.to(device)
      session_scale_mapping_list = get_argmin_mat(timestamps_in_scales)
      scale_list = list(range(len(timestamps_in_scales)))
      for scale_idx in scale_list:
          mapping_argmat = session_scale_mapping_list[scale_idx]
          emb_t = embeddings_in_scales[scale_idx].to(device)
          mapping_argmat = mapping_argmat.to(device)
          repeat_list = getRepeatedList(
              mapping_argmat, torch.tensor(emb_t.shape[0])
          ).to(device)
          rep_emb_t = torch.repeat_interleave(
              emb_t, repeats=repeat_list, dim=0
          )
          rep_mat_list.append(rep_emb_t)
      stacked_scale_embs = torch.stack(rep_mat_list)
      context_emb = (
          torch.matmul(
              stacked_scale_embs.permute(2, 1, 0),
              multiscale_weights.t(),
          )
          .squeeze()
          .t()
      )
      if len(context_emb.shape) < 2:
          context_emb = context_emb.unsqueeze(0)
      context_emb = context_emb.to(device)
      return context_emb, session_scale_mapping_list
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 14 for calling a global function with example usage: get_scale_interpolated_embs(multiscale_weights, embeddings_in_scales, timestamps_in_scales, device) and returns: context_emb,  session_scale_mapping_list