class_docstr: Dynamic convolution attention from
  https://arxiv.org/pdf/1910.10288.pdf
  
  
  query -> linear -> tanh -> linear ->|
                                      |                                            mask values
                                      v                                              |    |
             atten_w(t-1) -|-> conv1d_dynamic -> linear -|-> tanh -> + -> softmax -> * -> * -> context
                           |-> conv1d_static  -> linear -|           |
                           |-> conv1d_prior   -> log ----------------|
  
  query: attention rnn output.
  
  Note:
      Dynamic convolution attention is an alternation of the location senstive attention with
  dynamically computed convolution filters from the previous attention scores and a set of
  constraints to keep the attention alignment diagonal.
      DCA is sensitive to mixed precision training and might cause instable training.
  
  Args:
      query_dim (int): number of channels in the query tensor.
      embedding_dim (int): number of channels in the value tensor.
      static_filter_dim (int): number of channels in the convolution layer computing the static filters.
      static_kernel_size (int): kernel size for the convolution layer computing the static filters.
      dynamic_filter_dim (int): number of channels in the convolution layer computing the dynamic filters.
      dynamic_kernel_size (int): kernel size for the convolution layer computing the dynamic filters.
      prior_filter_len (int, optional): [description]. Defaults to 11 from the paper.
      alpha (float, optional): [description]. Defaults to 0.1 from the paper.
      beta (float, optional): [description]. Defaults to 0.9 from the paper.
docstr: query: [B, C_attn_rnn]
  inputs: [B, T_en, D_en]
  processed_inputs: place holder.
  mask: [B, T_en]
docstr_tok: ["query",":","[","B",",","C_attn_rnn","]","inputs",":","[","B",",","T_en",",","D_en","]","processed_inputs",":","place","holder",".","mask",":","[","B",",","T_en","]"]
code: def forward(self, query, inputs, processed_inputs, mask):
      """
      query: [B, C_attn_rnn]
      inputs: [B, T_en, D_en]
      processed_inputs: place holder.
      mask: [B, T_en]
      """
      # compute prior filters
      prior_filter = F.conv1d(
          F.pad(
              self.attention_weights.unsqueeze(1),
              (self.prior_filter_len - 1, 0),
          ),
          self.prior.view(1, 1, -1),
      )
      prior_filter = torch.log(prior_filter.clamp_min_(1e-6)).squeeze(1)
      G = self.key_layer(torch.tanh(self.query_layer(query)))
      # compute dynamic filters
      dynamic_filter = F.conv1d(
          self.attention_weights.unsqueeze(0),
          G.view(-1, 1, self.dynamic_kernel_size),
          padding=(self.dynamic_kernel_size - 1) // 2,
          groups=query.size(0),
      )
      dynamic_filter = dynamic_filter.view(
          query.size(0), self.dynamic_filter_dim, -1
      ).transpose(1, 2)
      # compute static filters
      static_filter = self.static_filter_conv(
          self.attention_weights.unsqueeze(1)
      ).transpose(1, 2)
      alignment = (
          self.v(
              torch.tanh(
                  self.static_filter_layer(static_filter)
                  + self.dynamic_filter_layer(dynamic_filter)
              )
          ).squeeze(-1)
          + prior_filter
      )
      # compute attention weights
      attention_weights = F.softmax(alignment, dim=-1)
      # apply masking
      if mask is not None:
          attention_weights.data.masked_fill_(~mask, self._mask_value)
      self.attention_weights = attention_weights
      # compute context
      context = torch.bmm(
          attention_weights.unsqueeze(1), inputs
      ).squeeze(1)
      return context
  
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 2 for calling the MonotonicDynamicConvolutionAttention obj's underlying member method code with example usage: obj.forward(query, inputs, processed_inputs, mask) and returns: context