class_docstr: Implements decoder layer in DETR transformer.
  
  Args:
      attn_cfgs (list[`mmcv.ConfigDict`] | list[dict] | dict )):
          Configs for self_attention or cross_attention, the order
          should be consistent with it in `operation_order`. If it is
          a dict, it would be expand to the number of attention in
          `operation_order`.
      feedforward_channels (int): The hidden dimension for FFNs.
      ffn_dropout (float): Probability of an element to be zeroed
          in ffn. Default 0.0.
      operation_order (tuple[str]): The execution order of operation
          in transformer. Such as ('self_attn', 'norm', 'ffn', 'norm').
          Default：None
      act_cfg (dict): The activation config for FFNs. Default: `LN`
      norm_cfg (dict): Config dict for normalization layer.
          Default: `LN`.
      ffn_num_fcs (int): The number of fully-connected layers in FFNs.
          Default：2.
class_docstr_tok: ["Implements","decoder","layer","in","DETR","transformer",".","Args",":","attn_cfgs","(","list","[","`","mmcv.ConfigDict","`","]","|","list","[","dict","]","|","dict",")",")",":","Configs","for","self_attention","or","cross_attention",",","the","order","should","be","consistent","with","it","in","`","operation_order","`",".","If","it","is","a","dict",",","it","would","be","expand","to","the","number","of","attention","in","`","operation_order","`",".","feedforward_channels","(","int",")",":","The","hidden","dimension","for","FFNs",".","ffn_dropout","(","float",")",":","Probability","of","an","element","to","be","zeroed","in","ffn",".","Default","0.0.","operation_order","(","tuple","[","str","]",")",":","The","execution","order","of","operation","in","transformer",".","Such","as","(","'self_attn","'",",","'norm","'",",","'ffn","'",",","'norm","'",")",".","Default\uff1aNone","act_cfg","(","dict",")",":","The","activation","config","for","FFNs",".","Default",":","`","LN","`","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","`","LN","`",".","ffn_num_fcs","(","int",")",":","The","number","of","fully-connected","layers","in","FFNs",".","Default\uff1a2","."]
code: def __init__(
      self,
      attn_cfgs,
      feedforward_channels,
      ffn_dropout=0.0,
      operation_order=None,
      act_cfg=dict(type="ReLU", inplace=True),
      norm_cfg=dict(type="LN"),
      ffn_num_fcs=2,
      **kwargs,
  ):
      super(DetrTransformerDecoderLayer, self).__init__(
          attn_cfgs=attn_cfgs,
          feedforward_channels=feedforward_channels,
          ffn_dropout=ffn_dropout,
          operation_order=operation_order,
          act_cfg=act_cfg,
          norm_cfg=norm_cfg,
          ffn_num_fcs=ffn_num_fcs,
          **kwargs,
      )
      assert len(operation_order) == 6
      assert set(operation_order) == set(
          ["self_attn", "norm", "cross_attn", "ffn"]
      )
  
imports: import math
  import warnings
  import torch
  import torch.nn
  from mmcv.cnn import build_norm_layer
  from mmcv.cnn.bricks.transformer import BaseTransformerLayer, TransformerLayerSequence, build_transformer_layer_sequence
  from mmcv.ops import MultiScaleDeformableAttention
  from mmengine.model import BaseModule
  from mmengine.model.weight_init import xavier_init
  from torch.nn.init import normal_
  from mmdet.models.layers.transformer import inverse_sigmoid
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 to create a new DetrTransformerDecoderLayer object from inherited base classes: BaseTransformerLayer with example: obj = DetrTransformerDecoderLayer(attn_cfgs, feedforward_channels, ffn_dropout, operation_order, act_cfg, norm_cfg, ffn_num_fcs)