class_docstr: Learning to downsample module.
  
  Args:
      in_channels (int): Number of input channels.
      dw_channels (tuple[int]): Number of output channels of the first and
          the second depthwise conv (dwconv) layers.
      out_channels (int): Number of output channels of the whole
          'learning to downsample' module.
      conv_cfg (dict | None): Config of conv layers. Default: None
      norm_cfg (dict | None): Config of norm layers. Default:
          dict(type='BN')
      act_cfg (dict): Config of activation layers. Default:
          dict(type='ReLU')
class_docstr_tok: ["Learning","to","downsample","module",".","Args",":","in_channels","(","int",")",":","Number","of","input","channels",".","dw_channels","(","tuple","[","int","]",")",":","Number","of","output","channels","of","the","first","and","the","second","depthwise","conv","(","dwconv",")","layers",".","out_channels","(","int",")",":","Number","of","output","channels","of","the","whole","'learning","to","downsample","'","module",".","conv_cfg","(","dict","|","None",")",":","Config","of","conv","layers",".","Default",":","None","norm_cfg","(","dict","|","None",")",":","Config","of","norm","layers",".","Default",":","dict","(","type='BN","'",")","act_cfg","(","dict",")",":","Config","of","activation","layers",".","Default",":","dict","(","type='ReLU","'",")"]
code: def __init__(
      self,
      in_channels,
      dw_channels,
      out_channels,
      conv_cfg=None,
      norm_cfg=dict(type="BN"),
      act_cfg=dict(type="ReLU"),
  ):
      super(LearningToDownsample, self).__init__()
      self.conv_cfg = conv_cfg
      self.norm_cfg = norm_cfg
      self.act_cfg = act_cfg
      dw_channels1 = dw_channels[0]
      dw_channels2 = dw_channels[1]
  
      self.conv = ConvModule(
          in_channels,
          dw_channels1,
          3,
          stride=2,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
      self.dsconv1 = DepthwiseSeparableConvModule(
          dw_channels1,
          dw_channels2,
          kernel_size=3,
          stride=2,
          padding=1,
          norm_cfg=self.norm_cfg,
      )
      self.dsconv2 = DepthwiseSeparableConvModule(
          dw_channels2,
          out_channels,
          kernel_size=3,
          stride=2,
          padding=1,
          norm_cfg=self.norm_cfg,
      )
  
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule, DepthwiseSeparableConvModule, constant_init, kaiming_init
  from torch.nn.modules.batchnorm import _BatchNorm
  from annotator.uniformer.mmseg.models.decode_heads.psp_head import PPM
  from annotator.uniformer.mmseg.ops import resize
  from ..builder import BACKBONES
  from ..utils.inverted_residual import InvertedResidual
label_desc: Use image node_id 1 to create a new LearningToDownsample object from inherited base classes: nn with example: obj = LearningToDownsample(in_channels, dw_channels, out_channels, conv_cfg, norm_cfg, act_cfg)