code: def __init__(
      self,
      num_queries=100,
      position_embed_type="sine",
      return_intermediate_dec=True,
      backbone_num_channels=2048,
      hidden_dim=256,
      nhead=8,
      num_encoder_layers=6,
      num_decoder_layers=6,
      dim_feedforward=2048,
      dropout=0.1,
      activation="relu",
      pe_temperature=10000,
      pe_offset=0.0,
      attn_dropout=None,
      act_dropout=None,
      normalize_before=False,
  ):
      super(DETRTransformer, self).__init__()
      assert position_embed_type in [
          "sine",
          "learned",
      ], f"ValueError: position_embed_type not supported {position_embed_type}!"
      self.hidden_dim = hidden_dim
      self.nhead = nhead
  
      encoder_layer = TransformerEncoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          attn_dropout,
          act_dropout,
          normalize_before,
      )
      encoder_norm = (
          nn.LayerNorm(hidden_dim) if normalize_before else None
      )
      self.encoder = TransformerEncoder(
          encoder_layer, num_encoder_layers, encoder_norm
      )
  
      decoder_layer = TransformerDecoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          attn_dropout,
          act_dropout,
          normalize_before,
      )
      decoder_norm = nn.LayerNorm(hidden_dim)
      self.decoder = TransformerDecoder(
          decoder_layer,
          num_decoder_layers,
          decoder_norm,
          return_intermediate=return_intermediate_dec,
      )
  
      self.input_proj = nn.Conv2D(
          backbone_num_channels, hidden_dim, kernel_size=1
      )
      self.query_pos_embed = nn.Embedding(num_queries, hidden_dim)
      self.position_embedding = PositionEmbedding(
          hidden_dim // 2,
          temperature=pe_temperature,
          normalize=True if position_embed_type == "sine" else False,
          embed_type=position_embed_type,
          offset=pe_offset,
      )
  
      self._reset_parameters()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..layers import MultiHeadAttention, _convert_attention_mask
  from .position_encoding import PositionEmbedding
  from .utils import _get_clones
  from ..initializer import linear_init_, conv_init_, xavier_uniform_, normal_
label_desc: Use image node_id 1 to create a new DETRTransformer object from inherited base classes: nn with example: obj = DETRTransformer(num_queries, position_embed_type, return_intermediate_dec, backbone_num_channels, hidden_dim, nhead, num_encoder_layers, num_decoder_layers, dim_feedforward, dropout, activation, pe_temperature, pe_offset, attn_dropout, act_dropout, normalize_before)