code: def __init__(
      self, input_shape, conv_dim=256, norm="GN", mask_dim=256
  ):
      super().__init__()
      input_shape = sorted(
          input_shape.items(), key=lambda x: x[1]["stride"]
      )
      self.in_features = [k for k, v in input_shape]  # "res2" to "res5"
      feature_channels = [v["channels"] for k, v in input_shape]
  
      self.lateral_convs, self.output_convs = (
          nn.LayerList(),
          nn.LayerList(),
      )
      use_bias = norm == ""
      for idx, in_channels in enumerate(feature_channels):
          if idx == len(self.in_features) - 1:
              output_conv = layers.ConvNormAct(
                  in_channels,
                  conv_dim,
                  kernel_size=3,
                  bias_attr=use_bias,
                  norm=nn.GroupNorm(
                      num_groups=32, num_channels=conv_dim
                  ),
                  act_type="relu",
              )
              self.output_convs.append(output_conv)
              self.lateral_convs.append(None)
              for layer in output_conv.sublayers():
                  if hasattr(layer, "weight"):
                      param_init.kaiming_uniform(
                          layer.weight,
                          negative_slope=1,
                          nonlinearity="leaky_relu",
                      )
                  if getattr(layer, "bias", None) is not None:
                      param_init.constant_init(layer.bias, value=0)
          else:
              lateral_norm = nn.GroupNorm(
                  num_groups=32, num_channels=conv_dim
              )
              output_norm = nn.GroupNorm(
                  num_groups=32, num_channels=conv_dim
              )
  
              lateral_conv = layers.ConvNormAct(
                  in_channels,
                  conv_dim,
                  kernel_size=1,
                  bias_attr=False,
                  norm=lateral_norm,
              )
              output_conv = layers.ConvNormAct(
                  conv_dim,
                  conv_dim,
                  kernel_size=3,
                  stride=1,
                  padding=1,
                  bias_attr=use_bias,
                  norm=output_norm,
                  act_type="relu",
              )
              self.lateral_convs.append(lateral_conv)
              self.output_convs.append(output_conv)
  
              for layer in (
                  output_conv.sublayers() + lateral_conv.sublayers()
              ):
                  if hasattr(layer, "weight"):
                      param_init.kaiming_uniform(
                          layer.weight,
                          negative_slope=1,
                          nonlinearity="leaky_relu",
                      )
                  if getattr(layer, "bias", None) is not None:
                      param_init.constant_init(layer.bias, value=0)
  
      self.lateral_convs = self.lateral_convs[::-1]
      self.output_convs = self.output_convs[::-1]
  
      self.mask_features = layers.ConvNormAct(
          conv_dim, mask_dim, kernel_size=3, stride=1, padding=1
      )
      for layer in self.mask_features.sublayers():
          if hasattr(layer, "weight"):
              param_init.kaiming_uniform(
                  layer.weight,
                  negative_slope=1,
                  nonlinearity="leaky_relu",
              )
          if getattr(layer, "bias", None) is not None:
              param_init.constant_init(layer.bias, value=0)
  
imports: import math
  import copy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.utils import utils
  from paddleseg.core.train import check_logits_losses
label_desc: Use image node_id 1 to create a new BasePixelDecoder object from inherited base classes: nn with example: obj = BasePixelDecoder(input_shape, conv_dim, norm, mask_dim)