class_docstr: Transformer Encoder Layer.
  
  Args:
      d_model (int): The number of expected features
          in the decoder inputs (default=512).
      d_inner (int): The dimension of the feedforward
          network model (default=256).
      n_head (int): The number of heads in the
          multiheadattention models (default=8).
      d_k (int): Total number of features in key.
      d_v (int): Total number of features in value.
      dropout (float): Dropout layer on attn_output_weights.
      qkv_bias (bool): Add bias in projection layer. Default: False.
      act_cfg (dict): Activation cfg for feedforward module.
      operation_order (tuple[str]): The execution order of operation
          in transformer. Such as ('self_attn', 'norm', 'ffn', 'norm')
          or ('norm', 'self_attn', 'norm', 'ffn').
          Default：None.
code: def forward(self, x, mask=None):
      if self.operation_order == ("self_attn", "norm", "ffn", "norm"):
          residual = x
          x = residual + self.attn(x, x, x, mask)
          x = self.norm1(x)
  
          residual = x
          x = residual + self.mlp(x)
          x = self.norm2(x)
      elif self.operation_order == ("norm", "self_attn", "norm", "ffn"):
          residual = x
          x = self.norm1(x)
          x = residual + self.attn(x, x, x, mask)
  
          residual = x
          x = self.norm2(x)
          x = residual + self.mlp(x)
  
      return x
  
file_path: mmocr/mmocr/models/common/layers/transformer_layers.py
imports: import torch.nn
  from mmengine.model import BaseModule
  from mmocr.models.common.modules import MultiHeadAttention, PositionwiseFeedForward
label_desc: Use image node_id 2 for calling the TFEncoderLayer obj's underlying member method code with example usage: obj.forward(x, mask) and returns: x