class_docstr: A location-based attention layer consisting of a Xavier-initialized
  convolutional layer followed by a dense layer
  
  Arguments
  ---------
  attention_n_filters: int
      the number of filters used in attention
  
  attention_kernel_size: int
      the kernel size of the attention layer
  
  attention_dim: int
      the dimension of linear attention layers
  
  
  Example
  -------
  >>> import torch
  >>> from speechbrain.lobes.models.Tacotron2 import LocationLayer
  >>> layer = LocationLayer()
  >>> attention_weights_cat = torch.randn(3, 2, 64)
  >>> processed_attention = layer(attention_weights_cat)
  >>> processed_attention.shape
  torch.Size([3, 64, 128])
class_docstr_tok: ["A","location-based","attention","layer","consisting","of","a","Xavier-initialized","convolutional","layer","followed","by","a","dense","layer","Arguments","--","--","--","--","-","attention_n_filters",":","int","the","number","of","filters","used","in","attention","attention_kernel_size",":","int","the","kernel","size","of","the","attention","layer","attention_dim",":","int","the","dimension","of","linear","attention","layers","Example","--","--","--","-",">",">",">","import","torch",">",">",">","from","speechbrain.lobes.models.Tacotron2","import","LocationLayer",">",">",">","layer","=","LocationLayer","(",")",">",">",">","attention_weights_cat","=","torch.randn","(","3",",","2",",","64",")",">",">",">","processed_attention","=","layer","(","attention_weights_cat",")",">",">",">","processed_attention.shape","torch.Size","(","[","3",",","64",",","128","]",")"]
docstr: Performs the forward pass for the attention layer
  
  Arguments
  ---------
  attention_weights_cat: torch.Tensor
      the concatenating attention weights
  
  Results
  -------
  processed_attention: torch.Tensor
      the attention layer output
docstr_tok: ["Performs","the","forward","pass","for","the","attention","layer","Arguments","--","--","--","--","-","attention_weights_cat",":","torch.Tensor","the","concatenating","attention","weights","Results","--","--","--","-","processed_attention",":","torch.Tensor","the","attention","layer","output"]
code: def forward(self, attention_weights_cat):
      """Performs the forward pass for the attention layer
  
      Arguments
      ---------
      attention_weights_cat: torch.Tensor
          the concatenating attention weights
  
      Results
      -------
      processed_attention: torch.Tensor
          the attention layer output
  
      """
      processed_attention = self.location_conv(attention_weights_cat)
      processed_attention = processed_attention.transpose(1, 2)
      processed_attention = self.location_dense(processed_attention)
      return processed_attention
  
imports: from math import sqrt
  from speechbrain.nnet.loss.guidedattn_loss import GuidedAttentionLoss
  from speechbrain.lobes.models.transformer.Transformer import get_mask_from_lengths
  import torch
  from torch import nn
  from torch.nn import functional
  from collections import namedtuple
label_desc: Use image node_id 2 for calling the LocationLayer obj's underlying member method code with example usage: obj.forward(attention_weights_cat) and returns: processed_attention