class_docstr: Graves Attention as is ref1 with updates from ref2.
  ref1: https://arxiv.org/abs/1910.10288
  ref2: https://arxiv.org/pdf/1906.01083.pdf
  
  Args:
      query_dim (int): number of channels in query tensor.
      K (int): number of Gaussian heads to be used for computing attention.
docstr: Shapes:
      query: [B, C_attention_rnn]
      inputs: [B, T_in, C_encoder]
      processed_inputs: place_holder
      mask: [B, T_in]
docstr_tok: ["Shapes",":","query",":","[","B",",","C_attention_rnn","]","inputs",":","[","B",",","T_in",",","C_encoder","]","processed_inputs",":","place_holder","mask",":","[","B",",","T_in","]"]
code: def forward(self, query, inputs, processed_inputs, mask):
      """
      Shapes:
          query: [B, C_attention_rnn]
          inputs: [B, T_in, C_encoder]
          processed_inputs: place_holder
          mask: [B, T_in]
      """
      gbk_t = self.N_a(query)
      gbk_t = gbk_t.view(gbk_t.size(0), -1, self.K)
  
      # attention model parameters
      # each B x K
      g_t = gbk_t[:, 0, :]
      b_t = gbk_t[:, 1, :]
      k_t = gbk_t[:, 2, :]
  
      # dropout to decorrelate attention heads
      g_t = torch.nn.functional.dropout(
          g_t, p=0.5, training=self.training
      )
  
      # attention GMM parameters
      sig_t = torch.nn.functional.softplus(b_t) + self.eps
  
      mu_t = self.mu_prev + torch.nn.functional.softplus(k_t)
      g_t = torch.softmax(g_t, dim=-1) + self.eps
  
      j = self.J[: inputs.size(1) + 1]
  
      # attention weights
      phi_t = g_t.unsqueeze(-1) * (
          1
          / (
              1
              + torch.sigmoid(
                  (mu_t.unsqueeze(-1) - j) / sig_t.unsqueeze(-1)
              )
          )
      )
  
      # discritize attention weights
      alpha_t = torch.sum(phi_t, 1)
      alpha_t = alpha_t[:, 1:] - alpha_t[:, :-1]
      alpha_t[alpha_t == 0] = 1e-8
  
      # apply masking
      if mask is not None:
          alpha_t.data.masked_fill_(~mask, self._mask_value)
  
      context = torch.bmm(alpha_t.unsqueeze(1), inputs).squeeze(1)
      self.attention_weights = alpha_t
      self.mu_prev = mu_t
      return context
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from TTS.tts.layers.common_layers import Linear
  from scipy.stats import betabinom
label_desc: Use image node_id 5 for calling the GravesAttention obj's underlying member method code with example usage: obj.forward(query, inputs, processed_inputs, mask) and returns: context