code: def __init__(self, inplanes, planes, stride=1):
      super().__init__()
  
      # all conv layers have stride 1. an avgpool is performed after the second convolution when stride > 1
      self.conv1 = nn.Conv2d(inplanes, planes, 1, bias=False)
      self.bn1 = nn.BatchNorm2d(planes)
  
      self.conv2 = nn.Conv2d(planes, planes, 3, padding=1, bias=False)
      self.bn2 = nn.BatchNorm2d(planes)
  
      self.avgpool = (
          nn.AvgPool2d(stride) if stride > 1 else nn.Identity()
      )
  
      self.conv3 = nn.Conv2d(
          planes, planes * self.expansion, 1, bias=False
      )
      self.bn3 = nn.BatchNorm2d(planes * self.expansion)
  
      self.relu = nn.ReLU(inplace=True)
      self.downsample = None
      self.stride = stride
  
      if stride > 1 or inplanes != planes * Bottleneck.expansion:
          # downsampling layer is prepended with an avgpool, and the subsequent convolution has stride 1
          self.downsample = nn.Sequential(
              OrderedDict(
                  [
                      ("-1", nn.AvgPool2d(stride)),
                      (
                          "0",
                          nn.Conv2d(
                              inplanes,
                              planes * self.expansion,
                              1,
                              stride=1,
                              bias=False,
                          ),
                      ),
                      ("1", nn.BatchNorm2d(planes * self.expansion)),
                  ]
              )
          )
  
imports: from collections import OrderedDict
  from typing import Tuple, Union
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 to create a new Bottleneck object from inherited base classes: nn with example: obj = Bottleneck(inplanes, planes, stride)