code: def test_forward(self):
      base_channels = 64
      pixel_decoder_cfg = ConfigDict(
          dict(
              type="TransformerEncoderPixelDecoder",
              in_channels=[base_channels * 2**i for i in range(4)],
              feat_channels=base_channels,
              out_channels=base_channels,
              norm_cfg=dict(type="GN", num_groups=32),
              act_cfg=dict(type="ReLU"),
              encoder=dict(  # DetrTransformerEncoder
                  num_layers=6,
                  layer_cfg=dict(  # DetrTransformerEncoderLayer
                      self_attn_cfg=dict(  # MultiheadAttention
                          embed_dims=base_channels,
                          num_heads=8,
                          attn_drop=0.1,
                          proj_drop=0.1,
                          dropout_layer=None,
                          batch_first=True,
                      ),
                      ffn_cfg=dict(
                          embed_dims=base_channels,
                          feedforward_channels=base_channels * 8,
                          num_fcs=2,
                          act_cfg=dict(type="ReLU", inplace=True),
                          ffn_drop=0.1,
                          dropout_layer=None,
                          add_identity=True,
                      ),
                      norm_cfg=dict(type="LN"),
                      init_cfg=None,
                  ),
                  init_cfg=None,
              ),
              positional_encoding=dict(
                  num_feats=base_channels // 2, normalize=True
              ),
          )
      )
      self = MODELS.build(pixel_decoder_cfg)
      self.init_weights()
      img_metas = [
          {
              "batch_input_shape": (128, 160),
              "img_shape": (120, 160),
          },
          {
              "batch_input_shape": (128, 160),
              "img_shape": (125, 160),
          },
      ]
      feats = [
          torch.rand(
              (
                  2,
                  base_channels * 2**i,
                  4 * 2 ** (3 - i),
                  5 * 2 ** (3 - i),
              )
          )
          for i in range(4)
      ]
      mask_feature, memory = self(feats, img_metas)
  
      assert memory.shape[-2:] == feats[-1].shape[-2:]
      assert mask_feature.shape == feats[0].shape
  
file_path: mmdetection/tests/test_models/test_layers/test_plugins.py
imports: import unittest
  import pytest
  import torch
  from mmengine.config import ConfigDict
  from mmdet.models.layers import DropBlock
  from mmdet.registry import MODELS
  from mmdet.utils import register_all_modules
label_desc: Use image node_id 1 for calling the TestTransformerEncoderPixelDecoder obj's underlying member method code with example usage: obj.test_forward() without return types