class_docstr: Deformable Transformer Decoder layer used in Deformable DETR.
  
  Described in: https://arxiv.org/abs/2010.04159.
class_docstr_tok: ["Deformable","Transformer","Decoder","layer","used","in","Deformable","DETR",".","Described","in",":","https",":","\/\/arxiv.org\/abs\/2010.04159","."]
code: def __init__(
      self,
      embed_dim: int,
      num_heads: int,
      dropout: float,
      num_levels: int,
      num_points: int,
  ) -> None:
      super().__init__()
      # self attn
      self.self_attn = nn.MultiheadAttention(
          embed_dim, num_heads, dropout, batch_first=True
      )
      self.dropout1 = nn.Dropout(dropout)
      self.norm1 = nn.LayerNorm(embed_dim)
  
      # cross attn
      self.cross_attn = MultiScaleDeformableAttention(
          embed_dim, num_heads, num_levels, num_points
      )
      self.dropout2 = nn.Dropout(dropout)
      self.norm2 = nn.LayerNorm(embed_dim)
  
      # ffn
      self.linear1 = nn.Linear(embed_dim, embed_dim * 4)
      self.activation = nn.ReLU(inplace=True)
      self.dropout3 = nn.Dropout(dropout)
      self.linear2 = nn.Linear(embed_dim * 4, embed_dim)
      self.dropout4 = nn.Dropout(dropout)
      self.norm3 = nn.LayerNorm(embed_dim)
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from torch import nn
  from kornia.contrib.models.common import MLP, ConvNormAct
  from kornia.core import Module, Tensor, concatenate
label_desc: Use image node_id 1 to create a new TransformerDecoderLayer object from inherited base classes: Module with example: obj = TransformerDecoderLayer(embed_dim, num_heads, dropout, num_levels, num_points)