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","."]
docstr: Args:
      feats (list[Tensor]): Feature maps of each level. Each has
          shape of (batch_size, c, h, w).
      batch_img_metas (list[dict]): List of image information. Pass in
          for creating more accurate padding mask.
  
  Returns:
      tuple: a tuple containing the following:
  
          - mask_feature (Tensor): shape (batch_size, c, h, w).
          - memory (Tensor): shape (batch_size, c, h, w).
docstr_tok: ["Args",":","feats","(","list","[","Tensor","]",")",":","Feature","maps","of","each","level",".","Each","has","shape","of","(","batch_size",",","c",",","h",",","w",")",".","batch_img_metas","(","list","[","dict","]",")",":","List","of","image","information",".","Pass","in","for","creating","more","accurate","padding","mask",".","Returns",":","tuple",":","a","tuple","containing","the","following",":","-","mask_feature","(","Tensor",")",":","shape","(","batch_size",",","c",",","h",",","w",")",".","-","memory","(","Tensor",")",":","shape","(","batch_size",",","c",",","h",",","w",")","."]
code: def forward(
      self, feats: List[Tensor], batch_img_metas: List[dict]
  ) -> Tuple[Tensor, Tensor]:
      """
      Args:
          feats (list[Tensor]): Feature maps of each level. Each has
              shape of (batch_size, c, h, w).
          batch_img_metas (list[dict]): List of image information. Pass in
              for creating more accurate padding mask.
  
      Returns:
          tuple: a tuple containing the following:
  
              - mask_feature (Tensor): shape (batch_size, c, h, w).
              - memory (Tensor): shape (batch_size, c, h, w).
      """
      feat_last = feats[-1]
      bs, c, h, w = feat_last.shape
      input_img_h, input_img_w = batch_img_metas[0]["batch_input_shape"]
      padding_mask = feat_last.new_ones(
          (bs, input_img_h, input_img_w), dtype=torch.float32
      )
      for i in range(bs):
          img_h, img_w = batch_img_metas[i]["img_shape"]
          padding_mask[i, :img_h, :img_w] = 0
      padding_mask = (
          F.interpolate(
              padding_mask.unsqueeze(1),
              size=feat_last.shape[-2:],
              mode="nearest",
          )
          .to(torch.bool)
          .squeeze(1)
      )
  
      pos_embed = self.positional_encoding(padding_mask)
      feat_last = self.encoder_in_proj(feat_last)
      # (batch_size, c, h, w) -> (batch_size, num_queries, c)
      feat_last = feat_last.flatten(2).permute(0, 2, 1)
      pos_embed = pos_embed.flatten(2).permute(0, 2, 1)
      # (batch_size, h, w) -> (batch_size, h*w)
      padding_mask = padding_mask.flatten(1)
      memory = self.encoder(
          query=feat_last,
          query_pos=pos_embed,
          key_padding_mask=padding_mask,
      )
      # (batch_size, num_queries, c) -> (batch_size, c, h, w)
      memory = memory.permute(0, 2, 1).view(
          bs, self.encoder_embed_dims, h, w
      )
      y = self.encoder_out_proj(memory)
      for i in range(self.num_inputs - 2, -1, -1):
          x = feats[i]
          cur_feat = self.lateral_convs[i](x)
          y = cur_feat + F.interpolate(
              y, size=cur_feat.shape[-2:], mode="nearest"
          )
          y = self.output_convs[i](y)
  
      mask_feature = self.mask_feature(y)
      return mask_feature, memory
  
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 3 for calling the TransformerEncoderPixelDecoder obj's underlying member method code with example usage: obj.forward(feats, batch_img_metas) and returns: mask_feature,  memory