class_docstr: Base class for Multi-head attention.
  
  Parameters
  ----------
  att_dim_in
      Attention dimension (number of hidden units)
  heads
      Number of attention heads
  att_dim_out
      Output dimension (number of output units)
  dropout
      Dropout rate on attention scores
class_docstr_tok: ["Base","class","for","Multi-head","attention",".","Parameters","--","--","--","--","--","att_dim_in","Attention","dimension","(","number","of","hidden","units",")","heads","Number","of","attention","heads","att_dim_out","Output","dimension","(","number","of","output","units",")","dropout","Dropout","rate","on","attention","scores"]
code: def __init__(
      self,
      att_dim_in: int = 32,
      heads: int = 8,
      att_dim_out: int = 32,
      dropout: float = 0.0,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
  
      assert (
          att_dim_in % heads == 0
      ), "Number of heads {} must divide attention att_dim_in {}".format(
          heads, att_dim_in
      )
  
      self.att_dim_in = att_dim_in
      self.heads = heads
      self.att_dim_out = att_dim_out
      self.dropout = dropout
      self.dim_per_head = self.att_dim_in // self.heads
  
      with self.name_scope():
          self.dense_att = mx.gluon.nn.Dense(
              units=self.att_dim_out, flatten=False
          )
  
imports: from typing import Dict, Optional, Tuple
  import mxnet
  from mxnet.gluon import HybridBlock
  from gluonts.mx import Tensor
label_desc: Use image node_id 1 to create a new MultiHeadAttentionBase object from inherited base classes: HybridBlock with example: obj = MultiHeadAttentionBase(att_dim_in, heads, att_dim_out, dropout)