class_docstr: Implementation of `DETR: End-to-End Object Detection with Transformers.
  
  <https://arxiv.org/pdf/2005.12872>`_.
  
  Code is modified from the `official github repo
  <https://github.com/facebookresearch/detr>`_.
docstr: Initialize layers except for backbone, neck and bbox_head.
docstr_tok: ["Initialize","layers","except","for","backbone",",","neck","and","bbox_head","."]
code: def _init_layers(self) -> None:
      """Initialize layers except for backbone, neck and bbox_head."""
      self.positional_encoding = SinePositionalEncoding(
          **self.positional_encoding
      )
      self.encoder = DetrTransformerEncoder(**self.encoder)
      self.decoder = DetrTransformerDecoder(**self.decoder)
      self.embed_dims = self.encoder.embed_dims
      # NOTE The embed_dims is typically passed from the inside out.
      # For example in DETR, The embed_dims is passed as
      # self_attn -> the first encoder layer -> encoder -> detector.
      self.query_embedding = nn.Embedding(
          self.num_queries, self.embed_dims
      )
  
      num_feats = self.positional_encoding.num_feats
      assert num_feats * 2 == self.embed_dims, (
          "embed_dims should be exactly 2 times of num_feats. "
          f"Found {self.embed_dims} and {num_feats}."
      )
  
file_path: mmdetection/mmdet/models/detectors/detr.py
imports: from typing import Dict, Tuple
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList
  from ..layers import DetrTransformerDecoder, DetrTransformerEncoder, SinePositionalEncoding
  from .base_detr import DetectionTransformer
label_desc: Use image node_id 1 for calling the DETR obj's underlying member method code with example usage: obj._init_layers() without return types