code: def __init__(self, cfg, name=None):
      cfg["return_additional_info"] = True
      cfg["has_pooler"] = False
      super(ErnieModelForGeneration, self).__init__(cfg, name=name)
      initializer = F.initializer.TruncatedNormal(
          scale=cfg["initializer_range"]
      )
      d_model = cfg["hidden_size"]
      d_vocab = cfg["vocab_size"]
  
      self.mlm = _build_linear(
          d_model,
          d_model,
          append_name(name, "mask_lm_trans_fc"),
          initializer,
          act=cfg["hidden_act"],
      )
      self.mlm_ln = _build_ln(
          d_model, name=append_name(name, "mask_lm_trans")
      )
      self.mlm_bias = L.create_parameter(
          dtype="float32",
          shape=[d_vocab],
          attr=F.ParamAttr(
              name=append_name(name, "mask_lm_out_fc.b_0"),
              initializer=F.initializer.Constant(value=0.0),
          ),
          is_bias=True,
      )
  
file_path: PaddleHub/modules/text/text_generation/reading_pictures_writing_poems_for_midautumn/MidAutumnPoetry/model/modeling_ernie_gen.py
imports: import paddle.fluid
  import paddle.fluid.layers
  from .modeling_ernie import ErnieModel
  from .modeling_ernie import _build_linear, _build_ln, append_name
label_desc: Use image node_id 1 to create a new ErnieModelForGeneration object from inherited base classes: ErnieModel with example: obj = ErnieModelForGeneration(cfg, name)