code: def __init__(self, cfg, name=None):
      super(ErnieBlock, self).__init__()
      d_model = cfg["hidden_size"]
      initializer = F.initializer.TruncatedNormal(
          scale=cfg["initializer_range"]
      )
  
      self.attn = AttentionLayer(
          cfg, name=append_name(name, "multi_head_att")
      )
      self.ln1 = _build_ln(d_model, name=append_name(name, "post_att"))
      self.ffn = PositionwiseFeedForwardLayer(
          cfg, name=append_name(name, "ffn")
      )
      self.ln2 = _build_ln(d_model, name=append_name(name, "post_ffn"))
      prob = cfg.get(
          "intermediate_dropout_prob", cfg["hidden_dropout_prob"]
      )
      self.dropout = (
          lambda i: L.dropout(
              i,
              dropout_prob=prob,
              dropout_implementation="upscale_in_train",
          )
          if self.training
          else i
      )
  
imports: from __future__ import division
  from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import unicode_literals
  import logging
  import paddle.fluid.dygraph
  import paddle.fluid
  import paddle.fluid.layers
label_desc: Use image node_id 1 to create a new ErnieBlock object from inherited base class: D with example: obj = ErnieBlock(cfg, name)