class_docstr: Module for alignment text and mel spectrogram.
  
  Args:
      n_mel_channels: Dimension of mel spectrogram.
      n_text_channels: Dimension of text embeddings.
      n_att_channels: Dimension of model
      temperature: Temperature to scale distance by.
          Suggested to be 0.0005 when using dist_type "l2" and 15.0 when using "cosine".
      condition_types: List of types for nemo.collections.tts.modules.submodules.ConditionalInput.
      dist_type: Distance type to use for similarity measurement. Supports "l2" and "cosine" distance.
class_docstr_tok: ["Module","for","alignment","text","and","mel","spectrogram",".","Args",":","n_mel_channels",":","Dimension","of","mel","spectrogram",".","n_text_channels",":","Dimension","of","text","embeddings",".","n_att_channels",":","Dimension","of","model","temperature",":","Temperature","to","scale","distance","by",".","Suggested","to","be","0.0005","when","using","dist_type","``","l2","''","and","15.0","when","using","``","cosine","''",".","condition_types",":","List","of","types","for","nemo.collections.tts.modules.submodules.ConditionalInput",".","dist_type",":","Distance","type","to","use","for","similarity","measurement",".","Supports","``","l2","''","and","``","cosine","''","distance","."]
docstr: Calculation of distance matrix.
  
  Args:
      queries (torch.tensor): B x C1 x T1 tensor (probably going to be mel data).
      keys (torch.tensor): B x C2 x T2 tensor (text data).
      mask (torch.tensor): B x T2 x 1 tensor, binary mask for variable length entries and also can be used
          for ignoring unnecessary elements from keys in the resulting distance matrix (True = mask element, False = leave unchanged).
  Output:
      dist (torch.tensor): B x T1 x T2 tensor.
docstr_tok: ["Calculation","of","distance","matrix",".","Args",":","queries","(","torch.tensor",")",":","B","x","C1","x","T1","tensor","(","probably","going","to","be","mel","data",")",".","keys","(","torch.tensor",")",":","B","x","C2","x","T2","tensor","(","text","data",")",".","mask","(","torch.tensor",")",":","B","x","T2","x","1","tensor",",","binary","mask","for","variable","length","entries","and","also","can","be","used","for","ignoring","unnecessary","elements","from","keys","in","the","resulting","distance","matrix","(","True","=","mask","element",",","False","=","leave","unchanged",")",".","Output",":","dist","(","torch.tensor",")",":","B","x","T1","x","T2","tensor","."]
code: def get_dist(self, keys, queries, mask=None):
      """Calculation of distance matrix.
  
      Args:
          queries (torch.tensor): B x C1 x T1 tensor (probably going to be mel data).
          keys (torch.tensor): B x C2 x T2 tensor (text data).
          mask (torch.tensor): B x T2 x 1 tensor, binary mask for variable length entries and also can be used
              for ignoring unnecessary elements from keys in the resulting distance matrix (True = mask element, False = leave unchanged).
      Output:
          dist (torch.tensor): B x T1 x T2 tensor.
      """
      # B x C x T1
      queries_enc = self.query_proj(queries)
      # B x C x T2
      keys_enc = self.key_proj(keys)
      # B x 1 x T1 x T2
      dist = self.dist_fn(queries_enc=queries_enc, keys_enc=keys_enc)
  
      self._apply_mask(dist, mask, float("inf"))
  
      return dist.squeeze(1)
  
file_path: NeMo/nemo/collections/tts/modules/aligner.py
imports: import torch
  from einops import rearrange
  from torch import nn
  from nemo.collections.tts.modules.submodules import ConditionalInput, ConvNorm
  from nemo.collections.tts.parts.utils.helpers import binarize_attention_parallel
label_desc: Use image node_id 3 for calling the AlignmentEncoder obj's underlying member method code with example usage: obj.get_dist(keys, queries, mask) and returns: dist