class_docstr: Pre-activation version of the BasicBlock.
code: def __init__(self, in_planes, planes, stride=1):
      super(PreActBlock, self).__init__()
      self.bn1 = nn.BatchNorm2d(in_planes)
      self.conv1 = nn.Conv2d(
          in_planes,
          planes,
          kernel_size=3,
          stride=stride,
          padding=1,
          bias=False,
      )
      self.bn2 = nn.BatchNorm2d(planes)
      self.conv2 = nn.Conv2d(
          planes, planes, kernel_size=3, stride=1, padding=1, bias=False
      )
  
      if stride != 1 or in_planes != self.expansion * planes:
          self.shortcut = nn.Sequential(
              nn.Conv2d(
                  in_planes,
                  self.expansion * planes,
                  kernel_size=1,
                  stride=stride,
                  bias=False,
              )
          )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new PreActBlock object from inherited base classes: nn with example: obj = PreActBlock(in_planes, planes, stride)