code: def __init__(
      self,
      in_channels,
      out_channels,
      stride,
      remove_first_relu,
      add_last_bn,
      preact=False,
  ):
      super(BottleneckBlock, self).__init__()
  
      self._remove_first_relu = remove_first_relu
      self._add_last_bn = add_last_bn
      self._preact = preact
  
      bottleneck_channels = out_channels // self.expansion
  
      self.bn1 = nn.BatchNorm2d(in_channels)
      self.conv1 = nn.Conv2d(
          in_channels,
          bottleneck_channels,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
      self.bn2 = nn.BatchNorm2d(bottleneck_channels)
      self.conv2 = nn.Conv2d(
          bottleneck_channels,
          bottleneck_channels,
          kernel_size=3,
          stride=stride,  # downsample with 3x3 conv
          padding=1,
          bias=False,
      )
      self.bn3 = nn.BatchNorm2d(bottleneck_channels)
      self.conv3 = nn.Conv2d(
          bottleneck_channels,
          out_channels,
          kernel_size=1,
          stride=1,
          padding=0,
          bias=False,
      )
  
      if add_last_bn:
          self.bn4 = nn.BatchNorm2d(out_channels)
  
      self.shortcut = nn.Sequential()  # identity
      if in_channels != out_channels:
          self.shortcut.add_module(
              "conv",
              nn.Conv2d(
                  in_channels,
                  out_channels,
                  kernel_size=1,
                  stride=stride,  # downsample
                  padding=0,
                  bias=False,
              ),
          )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from collections import OrderedDict
label_desc: Use image node_id 1 to create a new BottleneckBlock object from inherited base classes: nn with example: obj = BottleneckBlock(in_channels, out_channels, stride, remove_first_relu, add_last_bn, preact)