code: def __init__(self, cfg, name=None):
      super(PositionwiseFeedForwardLayer, self).__init__()
      initializer = F.initializer.TruncatedNormal(
          scale=cfg["initializer_range"]
      )
      d_model = cfg["hidden_size"]
      d_ffn = cfg.get("intermediate_size", 4 * d_model)
      assert cfg["hidden_act"] in ["relu", "gelu"]
      self.i = _build_linear(
          d_model,
          d_ffn,
          append_name(name, "fc_0"),
          initializer,
          act=cfg["hidden_act"],
      )
      self.o = _build_linear(
          d_ffn, d_model, append_name(name, "fc_1"), initializer
      )
      prob = cfg.get("intermediate_dropout_prob", 0.0)
      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 PositionwiseFeedForwardLayer object from inherited base class: D with example: obj = PositionwiseFeedForwardLayer(cfg, name)