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","."]
code: def __init__(
      self,
      attention_rnn_dim: int,
      encoder_embedding_dim: int,
      attention_hidden_dim: int,
      attention_location_n_filter: int,
      attention_location_kernel_size: int,
  ) -> None:
      super().__init__()
      self.query_layer = _get_linear_layer(
          attention_rnn_dim,
          attention_hidden_dim,
          bias=False,
          w_init_gain="tanh",
      )
      self.memory_layer = _get_linear_layer(
          encoder_embedding_dim,
          attention_hidden_dim,
          bias=False,
          w_init_gain="tanh",
      )
      self.v = _get_linear_layer(attention_hidden_dim, 1, bias=False)
      self.location_layer = _LocationLayer(
          attention_location_n_filter,
          attention_location_kernel_size,
          attention_hidden_dim,
      )
      self.score_mask_value = -float("inf")
  
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 1 to create a new _Attention object from inherited base classes: nn with example: obj = _Attention(attention_rnn_dim, encoder_embedding_dim, attention_hidden_dim, attention_location_n_filter, attention_location_kernel_size)