class_docstr: EncoderLayer
class_docstr_tok: ["EncoderLayer"]
code: def __init__(
      self,
      n_head,
      d_key,
      d_value,
      d_model,
      d_inner_hid,
      prepostprocess_dropout,
      attention_dropout,
      relu_dropout,
      preprocess_cmd="n",
      postprocess_cmd="da",
  ):
      super(EncoderLayer, self).__init__()
      self.preprocesser1 = PrePostProcessLayer(
          preprocess_cmd, d_model, prepostprocess_dropout
      )
      self.self_attn = MultiHeadAttention(
          d_key, d_value, d_model, n_head, attention_dropout
      )
      self.postprocesser1 = PrePostProcessLayer(
          postprocess_cmd, d_model, prepostprocess_dropout
      )
  
      self.preprocesser2 = PrePostProcessLayer(
          preprocess_cmd, d_model, prepostprocess_dropout
      )
      self.ffn = FFN(d_inner_hid, d_model, relu_dropout)
      self.postprocesser2 = PrePostProcessLayer(
          postprocess_cmd, d_model, prepostprocess_dropout
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import ParamAttr, nn
  from paddle import nn, ParamAttr
  from paddle.nn import functional
  import numpy
label_desc: Use image node_id 1 to create a new EncoderLayer object from inherited base classes: nn with example: obj = EncoderLayer(n_head, d_key, d_value, d_model, d_inner_hid, prepostprocess_dropout, attention_dropout, relu_dropout, preprocess_cmd, postprocess_cmd)