class_docstr: Locally sensitive attention model.
  
  Args:
      attention_rnn_dim (int): Number of hidden units for RNN.
      encoder_embedding_dim (int): Number of embedding dimensions in the Encoder.
      attention_hidden_dim (int): Dimension of attention hidden representation.
      attention_location_n_filter (int): Number of filters for Attention model.
      attention_location_kernel_size (int): Kernel size for Attention model.
class_docstr_tok: ["Locally","sensitive","attention","model",".","Args",":","attention_rnn_dim","(","int",")",":","Number","of","hidden","units","for","RNN",".","encoder_embedding_dim","(","int",")",":","Number","of","embedding","dimensions","in","the","Encoder",".","attention_hidden_dim","(","int",")",":","Dimension","of","attention","hidden","representation",".","attention_location_n_filter","(","int",")",":","Number","of","filters","for","Attention","model",".","attention_location_kernel_size","(","int",")",":","Kernel","size","for","Attention","model","."]
docstr: Get the alignment vector.
  
  Args:
      query (Tensor): Decoder output with shape (n_batch, n_mels * n_frames_per_step).
      processed_memory (Tensor): Processed Encoder outputs
          with shape (n_batch, max of ``text_lengths``, attention_hidden_dim).
      attention_weights_cat (Tensor): Cumulative and previous attention weights
          with shape (n_batch, 2, max of ``text_lengths``).
  
  Returns:
      alignment (Tensor): attention weights, it is a tensor with shape (batch, max of ``text_lengths``).
docstr_tok: ["Get","the","alignment","vector",".","Args",":","query","(","Tensor",")",":","Decoder","output","with","shape","(","n_batch",",","n_mels","*","n_frames_per_step",")",".","processed_memory","(","Tensor",")",":","Processed","Encoder","outputs","with","shape","(","n_batch",",","max","of","``","text_lengths","``",",","attention_hidden_dim",")",".","attention_weights_cat","(","Tensor",")",":","Cumulative","and","previous","attention","weights","with","shape","(","n_batch",",","2",",","max","of","``","text_lengths","``",")",".","Returns",":","alignment","(","Tensor",")",":","attention","weights",",","it","is","a","tensor","with","shape","(","batch",",","max","of","``","text_lengths","``",")","."]
code: def _get_alignment_energies(
      self,
      query: Tensor,
      processed_memory: Tensor,
      attention_weights_cat: Tensor,
  ) -> Tensor:
      r"""Get the alignment vector.
  
      Args:
          query (Tensor): Decoder output with shape (n_batch, n_mels * n_frames_per_step).
          processed_memory (Tensor): Processed Encoder outputs
              with shape (n_batch, max of ``text_lengths``, attention_hidden_dim).
          attention_weights_cat (Tensor): Cumulative and previous attention weights
              with shape (n_batch, 2, max of ``text_lengths``).
  
      Returns:
          alignment (Tensor): attention weights, it is a tensor with shape (batch, max of ``text_lengths``).
      """
  
      processed_query = self.query_layer(query.unsqueeze(1))
      processed_attention_weights = self.location_layer(
          attention_weights_cat
      )
      energies = self.v(
          torch.tanh(
              processed_query
              + processed_attention_weights
              + processed_memory
          )
      )
  
      alignment = energies.squeeze(2)
      return alignment
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
label_desc: Use image node_id 2 for calling the _Attention obj's underlying member method code with example usage: obj._get_alignment_energies(query, processed_memory, attention_weights_cat) and returns: alignment