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","."]
code: def __init__(
      self,
      num_layers: int,
      layer_cfg: ConfigType,
      post_norm_cfg: OptConfigType = dict(type="LN"),
      return_intermediate: bool = True,
      init_cfg: Union[dict, ConfigDict] = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.layer_cfg = layer_cfg
      self.num_layers = num_layers
      self.post_norm_cfg = post_norm_cfg
      self.return_intermediate = return_intermediate
      self._init_layers()
  
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 1 to create a new DetrTransformerDecoder object from inherited base classes: BaseModule with example: obj = DetrTransformerDecoder(num_layers, layer_cfg, post_norm_cfg, return_intermediate, init_cfg)