code: def __init__(
      self,
      embed_dim=256,
      num_heads=8,
      num_encoder_layers=6,
      ff_dim=1024,
      dropout=0.1,
      num_feature_levels=4,
      enc_num_points=4,
  ):
      super().__init__()
  
      self.embed_dim = embed_dim
      self.num_heads = num_heads
  
      encoder_layer = MSDeformAttnTransformerEncoderLayer(
          embed_dim,
          ff_dim,
          dropout,
          num_feature_levels,
          num_heads,
          enc_num_points,
      )
      self.encoder = MSDeformAttnTransformerEncoder(
          encoder_layer, num_encoder_layers
      )
  
      self.level_embed = self.create_parameter(
          shape=[num_feature_levels, embed_dim],
          dtype="float32",
          default_initializer=nn.initializer.Uniform(),
      )
  
      self.init_weight()
  
imports: import copy
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import param_init
  from paddlepanseg.models.param_init import c2_xavier_fill, THLinearInitMixin
  from .common import Conv2D, PositionEmbeddingSine
  from ._ms_deform_attn import MSDeformAttn
label_desc: Use image node_id 1 to create a new MSDeformAttnTransformerEncoderOnly object from inherited base classes: nn, THLinearInitMixin with example: obj = MSDeformAttnTransformerEncoderOnly(embed_dim, num_heads, num_encoder_layers, ff_dim, dropout, num_feature_levels, enc_num_points)