class_docstr: Implementation of `Dense Distinct Query for
  End-to-End Object Detection <https://arxiv.org/abs/2303.12776>`_
  
  Code is modified from the `official github repo
  <https://github.com/jshilong/DDQ>`_.
  
  Args:
      dense_topk_ratio (float): Ratio of num_dense queries to num_queries.
          Defaults to 1.5.
      dqs_cfg (:obj:`ConfigDict` or dict, optional): Config of
          Distinct Queries Selection. Defaults to nms with
          `iou_threshold` = 0.8.
class_docstr_tok: ["Implementation","of","`","Dense","Distinct","Query","for","End-to-End","Object","Detection","<","https",":","\/\/arxiv.org\/abs\/2303.12776",">","`","_","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/jshilong\/DDQ",">","`","_",".","Args",":","dense_topk_ratio","(","float",")",":","Ratio","of","num_dense","queries","to","num_queries",".","Defaults","to","1.5.","dqs_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","of","Distinct","Queries","Selection",".","Defaults","to","nms","with","`","iou_threshold","`","=","0.8","."]
docstr: Initialize weights for Transformer and other components.
docstr_tok: ["Initialize","weights","for","Transformer","and","other","components","."]
code: def init_weights(self) -> None:
      """Initialize weights for Transformer and other components."""
      super(DeformableDETR, self).init_weights()
      for coder in self.encoder, self.decoder:
          for p in coder.parameters():
              if p.dim() > 1:
                  nn.init.xavier_uniform_(p)
      for m in self.modules():
          if isinstance(m, MultiScaleDeformableAttention):
              m.init_weights()
      nn.init.xavier_uniform_(self.memory_trans_fc.weight)
      normal_(self.level_embed)
  
file_path: mmdetection/mmdet/models/detectors/ddq_detr.py
imports: from typing import Dict, Tuple
  import torch
  from mmcv.ops import MultiScaleDeformableAttention, batched_nms
  from torch import Tensor, nn
  from torch.nn.init import normal_
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList
  from mmdet.structures.bbox import bbox_cxcywh_to_xyxy
  from mmdet.utils import OptConfigType
  from ..layers import DDQTransformerDecoder
  from ..utils import align_tensor
  from .deformable_detr import DeformableDETR
  from .dino import DINO
label_desc: Use image node_id 3 for calling the DDQDETR obj's underlying member method code with example usage: obj.init_weights() without return types