class_docstr: Decoder of Conditional DETR.
class_docstr_tok: ["Decoder","of","Conditional","DETR","."]
docstr: Initialize decoder layers and other layers.
docstr_tok: ["Initialize","decoder","layers","and","other","layers","."]
code: def _init_layers(self) -> None:
      """Initialize decoder layers and other layers."""
      self.layers = ModuleList(
          [
              ConditionalDetrTransformerDecoderLayer(**self.layer_cfg)
              for _ in range(self.num_layers)
          ]
      )
      self.embed_dims = self.layers[0].embed_dims
      self.post_norm = build_norm_layer(
          self.post_norm_cfg, self.embed_dims
      )[1]
      # conditional detr affline
      self.query_scale = MLP(
          self.embed_dims, self.embed_dims, self.embed_dims, 2
      )
      self.ref_point_head = MLP(self.embed_dims, self.embed_dims, 2, 2)
      # we have substitute 'qpos_proj' with 'qpos_sine_proj' except for
      # the first decoder layer), so 'qpos_proj' should be deleted
      # in other layers.
      for layer_id in range(self.num_layers - 1):
          self.layers[layer_id + 1].cross_attn.qpos_proj = None
  
file_path: mmdetection/mmdet/models/layers/transformer/conditional_detr_layers.py
imports: import torch
  from mmcv.cnn import build_norm_layer
  from mmcv.cnn.bricks.transformer import FFN
  from torch import Tensor
  from torch.nn import ModuleList
  from .detr_layers import DetrTransformerDecoder, DetrTransformerDecoderLayer
  from .utils import MLP, ConditionalAttention, coordinate_to_encoding
label_desc: Use image node_id 1 for calling the ConditionalDetrTransformerDecoder obj's underlying member method code with example usage: obj._init_layers() without return types