class_docstr: Bahdanau Attention with various optional modifications.
  - Location sensitive attnetion: https://arxiv.org/abs/1712.05884
  - Forward Attention: https://arxiv.org/abs/1807.06736 + state masking at inference
  - Using sigmoid instead of softmax normalization
  - Attention windowing at inference time
  
  Note:
      Location Sensitive Attention extends the additive attention mechanism
  to use cumulative attention weights from previous decoder time steps with the current time step features.
  
      Forward attention computes most probable monotonic alignment. The modified attention probabilities at each
  timestep are computed recursively by the forward algorithm.
  
      Transition agent in the forward attention explicitly gates the attention mechanism whether to move forward or
  stay at each decoder timestep.
  
      Attention windowing is a inductive prior that prevents the model from attending to previous and future timesteps
  beyond a certain window.
  
  Args:
      query_dim (int): number of channels in the query tensor.
      embedding_dim (int): number of channels in the vakue tensor. In general, the value tensor is the output of the encoder layer.
      attention_dim (int): number of channels of the inner attention layers.
      location_attention (bool): enable/disable location sensitive attention.
      attention_location_n_filters (int): number of location attention filters.
      attention_location_kernel_size (int): filter size of location attention convolution layer.
      windowing (int): window size for attention windowing. if it is 5, for computing the attention, it only considers the time steps [(t-5), ..., (t+5)] of the input.
      norm (str): normalization method applied to the attention weights. 'softmax' or 'sigmoid'
      forward_attn (bool): enable/disable forward attention.
      trans_agent (bool): enable/disable transition agent in the forward attention.
      forward_attn_mask (int): enable/disable an explicit masking in forward attention. It is useful to set at especially inference time.
code: def __init__(
      self,
      query_dim,
      embedding_dim,
      attention_dim,
      location_attention,
      attention_location_n_filters,
      attention_location_kernel_size,
      windowing,
      norm,
      forward_attn,
      trans_agent,
      forward_attn_mask,
  ):
      super().__init__()
      self.query_layer = Linear(
          query_dim, attention_dim, bias=False, init_gain="tanh"
      )
      self.inputs_layer = Linear(
          embedding_dim, attention_dim, bias=False, init_gain="tanh"
      )
      self.v = Linear(attention_dim, 1, bias=True)
      if trans_agent:
          self.ta = nn.Linear(query_dim + embedding_dim, 1, bias=True)
      if location_attention:
          self.location_layer = LocationLayer(
              attention_dim,
              attention_location_n_filters,
              attention_location_kernel_size,
          )
      self._mask_value = -float("inf")
      self.windowing = windowing
      self.win_idx = None
      self.norm = norm
      self.forward_attn = forward_attn
      self.trans_agent = trans_agent
      self.forward_attn_mask = forward_attn_mask
      self.location_attention = location_attention
  
imports: import torch
  from scipy.stats import betabinom
  from torch import nn
  from torch.nn import functional
  from TTS.tts.layers.tacotron.common_layers import Linear
label_desc: Use image node_id 1 to create a new OriginalAttention object from inherited base classes: nn with example: obj = OriginalAttention(query_dim, embedding_dim, attention_dim, location_attention, attention_location_n_filters, attention_location_kernel_size, windowing, norm, forward_attn, trans_agent, forward_attn_mask)