class_docstr: Location layer used in the Attention model.
  
  Args:
      attention_n_filter (int): Number of filters for attention model.
      attention_kernel_size (int): Kernel size for attention model.
      attention_hidden_dim (int): Dimension of attention hidden representation.
class_docstr_tok: ["Location","layer","used","in","the","Attention","model",".","Args",":","attention_n_filter","(","int",")",":","Number","of","filters","for","attention","model",".","attention_kernel_size","(","int",")",":","Kernel","size","for","attention","model",".","attention_hidden_dim","(","int",")",":","Dimension","of","attention","hidden","representation","."]
docstr: Location layer used in the Attention model.
  
  Args:
      attention_weights_cat (Tensor): Cumulative and previous attention weights
          with shape (n_batch, 2, max of ``text_lengths``).
  
  Returns:
      processed_attention (Tensor): Cumulative and previous attention weights
          with shape (n_batch, ``attention_hidden_dim``).
docstr_tok: ["Location","layer","used","in","the","Attention","model",".","Args",":","attention_weights_cat","(","Tensor",")",":","Cumulative","and","previous","attention","weights","with","shape","(","n_batch",",","2",",","max","of","``","text_lengths","``",")",".","Returns",":","processed_attention","(","Tensor",")",":","Cumulative","and","previous","attention","weights","with","shape","(","n_batch",",","``","attention_hidden_dim","``",")","."]
code: def forward(self, attention_weights_cat: Tensor) -> Tensor:
      r"""Location layer used in the Attention model.
  
      Args:
          attention_weights_cat (Tensor): Cumulative and previous attention weights
              with shape (n_batch, 2, max of ``text_lengths``).
  
      Returns:
          processed_attention (Tensor): Cumulative and previous attention weights
              with shape (n_batch, ``attention_hidden_dim``).
      """
      # (n_batch, attention_n_filter, text_lengths.max())
      processed_attention = self.location_conv(attention_weights_cat)
      processed_attention = processed_attention.transpose(1, 2)
      # (n_batch, text_lengths.max(), attention_hidden_dim)
      processed_attention = self.location_dense(processed_attention)
      return processed_attention
  
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 _LocationLayer obj's underlying member method code with example usage: obj.forward(attention_weights_cat) and returns: processed_attention