class_docstr: Encoder Layer
  Encoder layer contains attention, norm, mlp and residual
  Attributes:
      hidden_size: transformer feature dim
      attn_norm: nn.LayerNorm before attention
      mlp_norm: nn.LayerNorm before mlp
      mlp: mlp modual
      attn: attention modual
code: def __init__(
      self,
      embed_dim,
      num_heads,
      attn_head_size=None,
      qkv_bias=True,
      mlp_ratio=4.0,
      dropout=0.0,
      attention_dropout=0.0,
      droppath=0.0,
  ):
      super().__init__()
      w_attr_1, b_attr_1 = self._init_weights()
      self.attn_norm = nn.LayerNorm(
          embed_dim,
          weight_attr=w_attr_1,
          bias_attr=b_attr_1,
          epsilon=1e-6,
      )
  
      self.attn = Attention(
          embed_dim,
          num_heads,
          attn_head_size,
          qkv_bias,
          dropout,
          attention_dropout,
      )
      self.drop_path = (
          DropPath(droppath) if droppath > 0.0 else Identity()
      )
  
      w_attr_2, b_attr_2 = self._init_weights()
      self.mlp_norm = nn.LayerNorm(
          embed_dim,
          weight_attr=w_attr_2,
          bias_attr=b_attr_2,
          epsilon=1e-6,
      )
  
      self.mlp = Mlp(embed_dim, mlp_ratio, dropout)
  
imports: import copy
  import paddle
  import paddle.nn
  from disco_diffusion_ernievil_base.vit_b_16x.ernievil2.transformers.droppath import DropPath
label_desc: Use image node_id 1 to create a new EncoderLayer object from inherited base classes: nn with example: obj = EncoderLayer(embed_dim, num_heads, attn_head_size, qkv_bias, mlp_ratio, dropout, attention_dropout, droppath)