code: def __init__(
      self,
      attention_rnn_dim,
      embedding_dim,
      attention_dim,
      attention_location_n_filters,
      attention_location_kernel_size,
  ):
      super(Attention, self).__init__()
      self.query_layer = LinearNorm(
          attention_rnn_dim,
          attention_dim,
          bias=False,
          w_init_gain="tanh",
      )
      self.memory_layer = LinearNorm(
          embedding_dim, attention_dim, bias=False, w_init_gain="tanh"
      )
      self.v = LinearNorm(attention_dim, 1, bias=False)
      self.location_layer = LocationLayer(
          attention_location_n_filters,
          attention_location_kernel_size,
          attention_dim,
      )
      self.score_mask_value = -float("inf")
  
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 1 to create a new Attention object from inherited base classes: nn with example: obj = Attention(attention_rnn_dim, embedding_dim, attention_dim, attention_location_n_filters, attention_location_kernel_size)