class_docstr: Decoder of DETR.
  
  Args:
      num_layers (int): Number of decoder layers.
      layer_cfg (:obj:`ConfigDict` or dict): the config of each encoder
          layer. All the layers will share the same config.
      post_norm_cfg (:obj:`ConfigDict` or dict, optional): Config of the
          post normalization layer. Defaults to `LN`.
      return_intermediate (bool, optional): Whether to return outputs of
          intermediate layers. Defaults to `True`,
      init_cfg (:obj:`ConfigDict` or dict, optional): the config to control
          the initialization. Defaults to None.
class_docstr_tok: ["Decoder","of","DETR",".","Args",":","num_layers","(","int",")",":","Number","of","decoder","layers",".","layer_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","the","config","of","each","encoder","layer",".","All","the","layers","will","share","the","same","config",".","post_norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","of","the","post","normalization","layer",".","Defaults","to","`","LN","`",".","return_intermediate","(","bool",",","optional",")",":","Whether","to","return","outputs","of","intermediate","layers",".","Defaults","to","`","True","`",",","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","the","config","to","control","the","initialization",".","Defaults","to","None","."]
docstr: Initialize decoder layers.
docstr_tok: ["Initialize","decoder","layers","."]
code: def _init_layers(self) -> None:
      """Initialize decoder layers."""
      self.layers = ModuleList(
          [
              DetrTransformerDecoderLayer(**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]
  
imports: from typing import Union
  import torch
  from mmcv.cnn import build_norm_layer
  from mmcv.cnn.bricks.transformer import FFN, MultiheadAttention
  from mmengine import ConfigDict
  from mmengine.model import BaseModule, ModuleList
  from torch import Tensor
  from mmdet.utils import ConfigType, OptConfigType
label_desc: Use image node_id 2 for calling the DetrTransformerDecoder obj's underlying member method code with example usage: obj._init_layers() without return types