class_docstr: Implementation of `Deformable DETR: Deformable Transformers for
  End-to-End Object Detection <https://arxiv.org/abs/2010.04159>`_
  
  Code is modified from the `official github repo
  <https://github.com/fundamentalvision/Deformable-DETR>`_.
  
  Args:
      decoder (:obj:`ConfigDict` or dict, optional): Config of the
          Transformer decoder. Defaults to None.
      bbox_head (:obj:`ConfigDict` or dict, optional): Config for the
          bounding box head module. Defaults to None.
      with_box_refine (bool, optional): Whether to refine the references
          in the decoder. Defaults to `False`.
      as_two_stage (bool, optional): Whether to generate the proposal
          from the outputs of encoder. Defaults to `False`.
      num_feature_levels (int, optional): Number of feature levels.
          Defaults to 4.
docstr: Get the position embedding of the proposal.
  
  Args:
      proposals (Tensor): Not normalized proposals, has shape
          (bs, num_queries, 4) with the last dimension arranged as
          (cx, cy, w, h).
      num_pos_feats (int, optional): The feature dimension for each
          position along x, y, w, and h-axis. Note the final returned
          dimension for each position is 4 times of num_pos_feats.
          Default to 128.
      temperature (int, optional): The temperature used for scaling the
          position embedding. Defaults to 10000.
  
  Returns:
      Tensor: The position embedding of proposal, has shape
      (bs, num_queries, num_pos_feats * 4), with the last dimension
      arranged as (cx, cy, w, h)
docstr_tok: ["Get","the","position","embedding","of","the","proposal",".","Args",":","proposals","(","Tensor",")",":","Not","normalized","proposals",",","has","shape","(","bs",",","num_queries",",","4",")","with","the","last","dimension","arranged","as","(","cx",",","cy",",","w",",","h",")",".","num_pos_feats","(","int",",","optional",")",":","The","feature","dimension","for","each","position","along","x",",","y",",","w",",","and","h-axis",".","Note","the","final","returned","dimension","for","each","position","is","4","times","of","num_pos_feats",".","Default","to","128.","temperature","(","int",",","optional",")",":","The","temperature","used","for","scaling","the","position","embedding",".","Defaults","to","10000",".","Returns",":","Tensor",":","The","position","embedding","of","proposal",",","has","shape","(","bs",",","num_queries",",","num_pos_feats","*","4",")",",","with","the","last","dimension","arranged","as","(","cx",",","cy",",","w",",","h",")"]
code: def get_proposal_pos_embed(
      proposals: Tensor,
      num_pos_feats: int = 128,
      temperature: int = 10000,
  ) -> Tensor:
      """Get the position embedding of the proposal.
  
      Args:
          proposals (Tensor): Not normalized proposals, has shape
              (bs, num_queries, 4) with the last dimension arranged as
              (cx, cy, w, h).
          num_pos_feats (int, optional): The feature dimension for each
              position along x, y, w, and h-axis. Note the final returned
              dimension for each position is 4 times of num_pos_feats.
              Default to 128.
          temperature (int, optional): The temperature used for scaling the
              position embedding. Defaults to 10000.
  
      Returns:
          Tensor: The position embedding of proposal, has shape
          (bs, num_queries, num_pos_feats * 4), with the last dimension
          arranged as (cx, cy, w, h)
      """
      scale = 2 * math.pi
      dim_t = torch.arange(
          num_pos_feats, dtype=torch.float32, device=proposals.device
      )
      dim_t = temperature ** (2 * (dim_t // 2) / num_pos_feats)
      # N, L, 4
      proposals = proposals.sigmoid() * scale
      # N, L, 4, 128
      pos = proposals[:, :, :, None] / dim_t
      # N, L, 4, 64, 2
      pos = torch.stack(
          (pos[:, :, :, 0::2].sin(), pos[:, :, :, 1::2].cos()), dim=4
      ).flatten(2)
      return pos
  
imports: import math
  from typing import Dict, Tuple
  import torch
  import torch.nn.functional
  from mmcv.cnn.bricks.transformer import MultiScaleDeformableAttention
  from mmengine.model import xavier_init
  from torch import Tensor, nn
  from torch.nn.init import normal_
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList
  from mmdet.utils import OptConfigType
  from ..layers import DeformableDetrTransformerDecoder, DeformableDetrTransformerEncoder, SinePositionalEncoding
  from .base_detr import DetectionTransformer
label_desc: Use image node_id 10 for calling the DeformableDETR obj's underlying member method code with example usage: obj.get_proposal_pos_embed(proposals, num_pos_feats, temperature) and returns: pos