code: def __init__(self, config):
      super(Encoder, self).__init__()
      self.config_file = config
      self.var_len = config.var_len
      self.input_len = config.input_len
      self.output_len = config.output_len
      self.hidden_dims = config.model.hidden_dims
      self.nhead = config.model.nhead
      self.num_encoder_layer = config.model.encoder_layers
  
      self.enc_lins = nn.LayerList()
      self.dropout = config.model.dropout
      self.drop = nn.Dropout(self.dropout)
      for _ in range(self.num_encoder_layer):
          self.enc_lins.append(
              TransformerEncoderLayer(
                  d_model=self.hidden_dims,
                  nhead=self.nhead,
                  dropout=self.dropout,
                  activation="gelu",
                  attn_dropout=self.dropout,
                  act_dropout=self.dropout,
                  dims_feedforward=self.hidden_dims * 2,
              )
          )
  
imports: import pgl
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  from pgl.utils.logger import log
  import pgl.nn
  import math
label_desc: Use image node_id 1 to create a new Encoder object from inherited base classes: nn with example: obj = Encoder(config)