code: def __init__(self, inplanes: int, planes: int, stride: int = 1):
      # setting stride to 1 bc we use average pooling to downsample
      super().__init__(inplanes=inplanes, planes=planes, stride=1)
  
      if stride > 1 or inplanes != planes * AvgPoolBottleneck.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 * AvgPoolBottleneck.expansion,
                              1,
                              stride=1,
                              bias=False,
                          ),
                      ),
                      (
                          "1",
                          nn.BatchNorm2d(
                              planes * AvgPoolBottleneck.expansion
                          ),
                      ),
                  ]
              )
          )
  
      self.avgpool = (
          nn.AvgPool2d(stride) if stride > 1 else nn.Identity()
      )
  
imports: from collections import OrderedDict
  from typing import Optional, Tuple, Type
  import torch
  import torch.nn
  from torchvision.models.resnet import Bottleneck, conv1x1, conv3x3
  from torchvision.ops.misc import FrozenBatchNorm2d
label_desc: Use image node_id 1 to create a new AvgPoolBottleneck object from inherited base classes: Bottleneck with example: obj = AvgPoolBottleneck(inplanes, planes, stride)