docstr: PARAMS
  ------
  query: decoder output (batch, n_mel_channels * n_frames_per_step)
  processed_memory: processed encoder outputs (B, T_in, attention_dim)
  attention_weights_cat: cumulative and prev. att weights (B, 2, max_time)
  
  RETURNS
  -------
  alignment (batch, max_time)
docstr_tok: ["PARAMS","--","--","--","query",":","decoder","output","(","batch",",","n_mel_channels","*","n_frames_per_step",")","processed_memory",":","processed","encoder","outputs","(","B",",","T_in",",","attention_dim",")","attention_weights_cat",":","cumulative","and","prev",".","att","weights","(","B",",","2",",","max_time",")","RETURNS","--","--","--","-","alignment","(","batch",",","max_time",")"]
code: def get_alignment_energies(
      self, query, processed_memory, attention_weights_cat
  ):
      """
      PARAMS
      ------
      query: decoder output (batch, n_mel_channels * n_frames_per_step)
      processed_memory: processed encoder outputs (B, T_in, attention_dim)
      attention_weights_cat: cumulative and prev. att weights (B, 2, max_time)
  
      RETURNS
      -------
      alignment (batch, max_time)
      """
  
      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
          )
      )
  
      energies = energies.squeeze(-1)
      return energies
  
imports: from math import sqrt
  import torch
  import torch.distributions
  from torch.autograd import Variable
  from torch import nn
  from torch.nn import functional
  from .layers import ConvNorm, LinearNorm, GlobalAvgPool
  from .utils import to_gpu, get_mask_from_lengths
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: energies