class_docstr: Implement encoder layer for SATRN, see `SATRN.
  
  <https://arxiv.org/abs/1910.04396>`_.
  
  Args:
      d_model (int): Dimension :math:`D_m` of the input from previous model.
          Defaults to 512.
      d_inner (int): Hidden dimension of feedforward layers. Defaults to 256.
      n_head (int): Number of parallel attention heads. Defaults to 8.
      d_k (int): Dimension of the key vector. Defaults to 64.
      d_v (int): Dimension of the value vector. Defaults to 64.
      dropout (float): Dropout rate. Defaults to 0.1.
      qkv_bias (bool): Whether to use bias. Defaults to False.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
code: def __init__(
      self,
      d_model: int = 512,
      d_inner: int = 512,
      n_head: int = 8,
      d_k: int = 64,
      d_v: int = 64,
      dropout: float = 0.1,
      qkv_bias: bool = False,
      init_cfg: Optional[Union[Dict, List[Dict]]] = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.norm1 = nn.LayerNorm(d_model)
      self.attn = MultiHeadAttention(
          n_head, d_model, d_k, d_v, qkv_bias=qkv_bias, dropout=dropout
      )
      self.norm2 = nn.LayerNorm(d_model)
      self.feed_forward = LocalityAwareFeedforward(d_model, d_inner)
  
imports: from typing import Dict, List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmocr.models.common import MultiHeadAttention
label_desc: Use image node_id 1 to create a new SATRNEncoderLayer object from inherited base classes: BaseModule with example: obj = SATRNEncoderLayer(d_model, d_inner, n_head, d_k, d_v, dropout, qkv_bias, init_cfg)