class_docstr: Pixel decoder with transormer encoder inside.
  
  Args:
      in_channels (list[int] | tuple[int]): Number of channels in the
          input feature maps.
      feat_channels (int): Number channels for feature.
      out_channels (int): Number channels for output.
      norm_cfg (:obj:`ConfigDict` or dict): Config for normalization.
          Defaults to dict(type='GN', num_groups=32).
      act_cfg (:obj:`ConfigDict` or dict): Config for activation.
          Defaults to dict(type='ReLU').
      encoder (:obj:`ConfigDict` or dict): Config for transformer encoder.
          Defaults to None.
      positional_encoding (:obj:`ConfigDict` or dict): Config for
          transformer encoder position encoding. Defaults to
          dict(num_feats=128, normalize=True).
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict. Defaults to None.
class_docstr_tok: ["Pixel","decoder","with","transormer","encoder","inside",".","Args",":","in_channels","(","list","[","int","]","|","tuple","[","int","]",")",":","Number","of","channels","in","the","input","feature","maps",".","feat_channels","(","int",")",":","Number","channels","for","feature",".","out_channels","(","int",")",":","Number","channels","for","output",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","for","normalization",".","Defaults","to","dict","(","type='GN","'",",","num_groups=32",")",".","act_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","for","activation",".","Defaults","to","dict","(","type='ReLU","'",")",".","encoder","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","for","transformer","encoder",".","Defaults","to","None",".","positional_encoding","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","for","transformer","encoder","position","encoding",".","Defaults","to","dict","(","num_feats=128",",","normalize=True",")",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None","."]
code: def __init__(
      self,
      in_channels: Union[List[int], Tuple[int]],
      feat_channels: int,
      out_channels: int,
      norm_cfg: ConfigType = dict(type="GN", num_groups=32),
      act_cfg: ConfigType = dict(type="ReLU"),
      encoder: ConfigType = None,
      positional_encoding: ConfigType = dict(
          num_feats=128, normalize=True
      ),
      init_cfg: OptMultiConfig = None,
  ) -> None:
      super().__init__(
          in_channels=in_channels,
          feat_channels=feat_channels,
          out_channels=out_channels,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
          init_cfg=init_cfg,
      )
      self.last_feat_conv = None
  
      self.encoder = DetrTransformerEncoder(**encoder)
      self.encoder_embed_dims = self.encoder.embed_dims
      assert self.encoder_embed_dims == feat_channels, (
          "embed_dims({}) of "
          "tranformer encoder must equal to feat_channels({})".format(
              feat_channels, self.encoder_embed_dims
          )
      )
      self.positional_encoding = SinePositionalEncoding(
          **positional_encoding
      )
      self.encoder_in_proj = Conv2d(
          in_channels[-1], feat_channels, kernel_size=1
      )
      self.encoder_out_proj = ConvModule(
          feat_channels,
          feat_channels,
          kernel_size=3,
          stride=1,
          padding=1,
          bias=self.use_bias,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
      )
  
imports: from typing import List, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import Conv2d, ConvModule
  from mmengine.model import BaseModule, ModuleList, caffe2_xavier_init
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, OptMultiConfig
  from .positional_encoding import SinePositionalEncoding
  from .transformer import DetrTransformerEncoder
label_desc: Use image node_id 1 to create a new TransformerEncoderPixelDecoder object from inherited base classes: PixelDecoder with example: obj = TransformerEncoderPixelDecoder(in_channels, feat_channels, out_channels, norm_cfg, act_cfg, encoder, positional_encoding, init_cfg)