class_docstr: Implements decoder layer in DETR transformer.
  
  Args:
      self_attn_cfg (:obj:`ConfigDict` or dict, optional): Config for self
          attention.
      cross_attn_cfg (:obj:`ConfigDict` or dict, optional): Config for cross
          attention.
      ffn_cfg (:obj:`ConfigDict` or dict, optional): Config for FFN.
      norm_cfg (:obj:`ConfigDict` or dict, optional): Config for
          normalization layers. All the layers will share the same
          config. Defaults to `LN`.
      init_cfg (:obj:`ConfigDict` or dict, optional): Config to control
          the initialization. Defaults to None.
class_docstr_tok: ["Implements","decoder","layer","in","DETR","transformer",".","Args",":","self_attn_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","for","self","attention",".","cross_attn_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","for","cross","attention",".","ffn_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","for","FFN",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","for","normalization","layers",".","All","the","layers","will","share","the","same","config",".","Defaults","to","`","LN","`",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","to","control","the","initialization",".","Defaults","to","None","."]
docstr: Initialize self-attention, FFN, and normalization.
docstr_tok: ["Initialize","self-attention",",","FFN",",","and","normalization","."]
code: def _init_layers(self) -> None:
      """Initialize self-attention, FFN, and normalization."""
      self.self_attn = MultiheadAttention(**self.self_attn_cfg)
      self.cross_attn = MultiheadAttention(**self.cross_attn_cfg)
      self.embed_dims = self.self_attn.embed_dims
      self.ffn = FFN(**self.ffn_cfg)
      norms_list = [
          build_norm_layer(self.norm_cfg, self.embed_dims)[1]
          for _ in range(3)
      ]
      self.norms = ModuleList(norms_list)
  
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 DetrTransformerDecoderLayer obj's underlying member method code with example usage: obj._init_layers() without return types