class_docstr: Modified Alighed Xception
code: def __init__(self, inplanes=3, os=16, pretrained=False):
      super(Xception, self).__init__()
  
      if os == 16:
          entry_block3_stride = 2
          middle_block_rate = 1
          exit_block_rates = (1, 2)
      elif os == 8:
          entry_block3_stride = 1
          middle_block_rate = 2
          exit_block_rates = (2, 4)
      else:
          raise NotImplementedError
  
      # Entry flow
      self.conv1 = nn.Conv2d(
          inplanes, 32, 3, stride=2, padding=1, bias=False
      )
      self.bn1 = nn.BatchNorm2d(32)
      self.relu = nn.ReLU(inplace=True)
  
      self.conv2 = nn.Conv2d(32, 64, 3, stride=1, padding=1, bias=False)
      self.bn2 = nn.BatchNorm2d(64)
  
      self.block1 = Block(
          64, 128, reps=2, stride=2, start_with_relu=False
      )
      self.block2 = Block(
          128,
          256,
          reps=2,
          stride=2,
          start_with_relu=True,
          grow_first=True,
      )
      self.block3 = Block(
          256,
          728,
          reps=2,
          stride=entry_block3_stride,
          start_with_relu=True,
          grow_first=True,
      )
  
      # Middle flow
      self.block4 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block5 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block6 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block7 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block8 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block9 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block10 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block11 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block12 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block13 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block14 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block15 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block16 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block17 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block18 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
      self.block19 = Block(
          728,
          728,
          reps=3,
          stride=1,
          dilation=middle_block_rate,
          start_with_relu=True,
          grow_first=True,
      )
  
      # Exit flow
      self.block20 = Block(
          728,
          1024,
          reps=2,
          stride=1,
          dilation=exit_block_rates[0],
          start_with_relu=True,
          grow_first=False,
          is_last=True,
      )
  
      self.conv3 = SeparableConv2d_same(
          1024, 1536, 3, stride=1, dilation=exit_block_rates[1]
      )
      self.bn3 = nn.BatchNorm2d(1536)
  
      self.conv4 = SeparableConv2d_same(
          1536, 1536, 3, stride=1, dilation=exit_block_rates[1]
      )
      self.bn4 = nn.BatchNorm2d(1536)
  
      self.conv5 = SeparableConv2d_same(
          1536, 2048, 3, stride=1, dilation=exit_block_rates[1]
      )
      self.bn5 = nn.BatchNorm2d(2048)
  
      # Init weights
      self.__init_weight()
  
      # Load pretrained model
      if pretrained:
          self.__load_xception_pretrained()
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.model_zoo
label_desc: Use image node_id 1 to create a new Xception object from inherited base classes: nn with example: obj = Xception(inplanes, os, pretrained)