class_docstr: The transformer encoder.
  
  Args:
      encoder_layer(nn.Layer): The base layer to compose the encoder.
      num_layers(int): How many layers is used in the encoder.
      norm(str): the kind of normalization that used before output.
class_docstr_tok: ["The","transformer","encoder",".","Args",":","encoder_layer","(","nn.Layer",")",":","The","base","layer","to","compose","the","encoder",".","num_layers","(","int",")",":","How","many","layers","is","used","in","the","encoder",".","norm","(","str",")",":","the","kind","of","normalization","that","used","before","output","."]
code: def __init__(self, encoder_layer, num_layers, norm=None):
      super().__init__()
      self.layers = nn.LayerList()
      for i in range(num_layers):
          self.layers.append(encoder_layer)
      self.norm = norm
  
imports: import math
  import copy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.utils import utils
  from paddleseg.core.train import check_logits_losses
label_desc: Use image node_id 1 to create a new TransformerEncoder object from inherited base classes: nn with example: obj = TransformerEncoder(encoder_layer, num_layers, norm)