class_docstr: Implements the DeformableDETR transformer.
  
  Args:
      as_two_stage (bool): Generate query from encoder features.
          Default: False.
      num_feature_levels (int): Number of feature maps from FPN:
          Default: 4.
      two_stage_num_proposals (int): Number of proposals when set
          `as_two_stage` as True. Default: 300.
class_docstr_tok: ["Implements","the","DeformableDETR","transformer",".","Args",":","as_two_stage","(","bool",")",":","Generate","query","from","encoder","features",".","Default",":","False",".","num_feature_levels","(","int",")",":","Number","of","feature","maps","from","FPN",":","Default",":","4.","two_stage_num_proposals","(","int",")",":","Number","of","proposals","when","set","`","as_two_stage","`","as","True",".","Default",":","300","."]
docstr: Get the position embedding of proposal.
code: def get_proposal_pos_embed(
      self, proposals, num_pos_feats=128, temperature=10000
  ):
      """Get the position embedding of proposal."""
      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
  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 7 for calling the DeformableDetrTransformer obj's underlying member method code with example usage: obj.get_proposal_pos_embed(proposals, num_pos_feats, temperature) and returns: pos