class_docstr: ASPP module defined in DeepLab papers, `here <https://arxiv.org/abs/1606.00915>`_ and `here <https://arxiv.org/abs/1706.05587>`_
  
  Args:
      opts: command-line arguments
      in_channels (int): :math:`C_{in}` from an expected input of size :math:`(N, C_{in}, H, W)`
      out_channels (int): :math:`C_{out}` from an expected output of size :math:`(N, C_{out}, H, W)`
      atrous_rates (Tuple[int]): atrous rates for different branches.
      is_sep_conv (Optional[bool]): Use separable convolution instead of standaard conv. Default: False
      dropout (Optional[float]): Apply dropout. Default is 0.0
  
  Shape:
      - Input: :math:`(N, C_{in}, H, W)`
      - Output: :math:`(N, C_{out}, H, W)`
class_docstr_tok: ["ASPP","module","defined","in","DeepLab","papers",",","`","here","<","https",":","\/\/arxiv.org\/abs\/1606.00915",">","`","_","and","`","here","<","https",":","\/\/arxiv.org\/abs\/1706.05587",">","`","_","Args",":","opts",":","command-line","arguments","in_channels","(","int",")",":",":","math",":","`","C_","{","in","}","`","from","an","expected","input","of","size",":","math",":","`","(","N",",","C_","{","in","}",",","H",",","W",")","`","out_channels","(","int",")",":",":","math",":","`","C_","{","out","}","`","from","an","expected","output","of","size",":","math",":","`","(","N",",","C_","{","out","}",",","H",",","W",")","`","atrous_rates","(","Tuple","[","int","]",")",":","atrous","rates","for","different","branches",".","is_sep_conv","(","Optional","[","bool","]",")",":","Use","separable","convolution","instead","of","standaard","conv",".","Default",":","False","dropout","(","Optional","[","float","]",")",":","Apply","dropout",".","Default","is","0.0","Shape",":","-","Input",":",":","math",":","`","(","N",",","C_","{","in","}",",","H",",","W",")","`","-","Output",":",":","math",":","`","(","N",",","C_","{","out","}",",","H",",","W",")","`"]
code: def __init__(
      self,
      opts,
      in_channels: int,
      out_channels: int,
      atrous_rates: Tuple[int],
      is_sep_conv: Optional[bool] = False,
      dropout: Optional[float] = 0.0,
      *args,
      **kwargs,
  ) -> None:
      in_proj = ConvLayer2d(
          opts=opts,
          in_channels=in_channels,
          out_channels=out_channels,
          kernel_size=1,
          stride=1,
          use_norm=True,
          use_act=True,
      )
      out_proj = ConvLayer2d(
          opts=opts,
          in_channels=5 * out_channels,
          out_channels=out_channels,
          kernel_size=1,
          stride=1,
          use_norm=True,
          use_act=True,
      )
      aspp_layer = ASPPSeparableConv2d if is_sep_conv else ASPPConv2d
  
      assert len(atrous_rates) == 3
  
      modules = [in_proj]
      modules.extend(
          [
              aspp_layer(
                  opts=opts,
                  in_channels=in_channels,
                  out_channels=out_channels,
                  dilation=rate,
              )
              for rate in atrous_rates
          ]
      )
      modules.append(
          ASPPPooling(
              opts=opts,
              in_channels=in_channels,
              out_channels=out_channels,
          )
      )
  
      if not (0.0 <= dropout < 1.0):
          if is_master(opts):
              logger.warning(
                  "Dropout value in {} should be between 0 and 1. Got: {}. Setting it to 0.0".format(
                      self.__class__.__name__, dropout
                  )
              )
          dropout = 0.0
  
      super().__init__()
      self.convs = nn.ModuleList(modules)
      self.project = out_proj
  
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.atrous_rates = atrous_rates
      self.is_sep_conv_layer = is_sep_conv
      self.n_atrous_branches = len(atrous_rates)
      self.dropout_layer = Dropout2d(p=dropout)
  
imports: import argparse
  from typing import Optional, Tuple
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from cvnets.layers import AdaptiveAvgPool2d, BaseLayer, ConvLayer2d, Dropout2d, SeparableConv2d
  from cvnets.modules import BaseModule
  from utils import logger
  from utils.ddp_utils import is_master
label_desc: Use image node_id 1 to create a new ASPP object from inherited base classes: BaseModule with example: obj = ASPP(opts, in_channels, out_channels, atrous_rates, is_sep_conv, dropout)