class_docstr: Pooling Pyramid Module used in PSPNet.
  
  Args:
      pool_scales (tuple[int]): Pooling scales used in Pooling Pyramid
          Module.
      in_channels (int): Input channels.
      channels (int): Channels after modules, before conv_seg.
      conv_cfg (dict|None): Config of conv layers.
      norm_cfg (dict|None): Config of norm layers.
      act_cfg (dict): Config of activation layers.
      align_corners (bool): align_corners argument of F.interpolate.
class_docstr_tok: ["Pooling","Pyramid","Module","used","in","PSPNet",".","Args",":","pool_scales","(","tuple","[","int","]",")",":","Pooling","scales","used","in","Pooling","Pyramid","Module",".","in_channels","(","int",")",":","Input","channels",".","channels","(","int",")",":","Channels","after","modules",",","before","conv_seg",".","conv_cfg","(","dict|None",")",":","Config","of","conv","layers",".","norm_cfg","(","dict|None",")",":","Config","of","norm","layers",".","act_cfg","(","dict",")",":","Config","of","activation","layers",".","align_corners","(","bool",")",":","align_corners","argument","of","F.interpolate","."]
code: def __init__(
      self,
      pool_scales,
      in_channels,
      channels,
      conv_cfg,
      norm_cfg,
      act_cfg,
      align_corners,
  ):
      super(PPM, self).__init__()
      self.pool_scales = pool_scales
      self.align_corners = align_corners
      self.in_channels = in_channels
      self.channels = channels
      self.conv_cfg = conv_cfg
      self.norm_cfg = norm_cfg
      self.act_cfg = act_cfg
      for pool_scale in pool_scales:
          self.append(
              nn.Sequential(
                  nn.AdaptiveAvgPool2d(pool_scale),
                  ConvModule(
                      self.in_channels,
                      self.channels,
                      1,
                      conv_cfg=self.conv_cfg,
                      norm_cfg=self.norm_cfg,
                      act_cfg=self.act_cfg,
                  ),
              )
          )
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/decode_heads/psp_head.py
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule
  from annotator.uniformer.mmseg.ops import resize
  from ..builder import HEADS
  from .decode_head import BaseDecodeHead
label_desc: Use image node_id 1 to create a new PPM object from inherited base classes: nn with example: obj = PPM(pool_scales, in_channels, channels, conv_cfg, norm_cfg, act_cfg, align_corners)