code: def __init__(
      self, in_channels, down_channels, out_size, levels=(1, 2, 3, 6)
  ):
      super(_PyramidSpatialPoolingModule, self).__init__()
  
      self.out_channels = len(levels) * down_channels
  
      self.layers = nn.ModuleList()
      for level in levels:
          layer = nn.Sequential(
              nn.AdaptiveAvgPool2d(level),
              nn.Conv2d(
                  in_channels,
                  down_channels,
                  kernel_size=1,
                  padding=0,
                  bias=False,
              ),
              nn.BatchNorm2d(down_channels),
              nn.ReLU(inplace=True),
              nn.Upsample(size=out_size, mode="bilinear"),
          )
          self.layers.append(layer)
  
imports: from ..None import resnext101_64x4d
  from math import floor
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new _PyramidSpatialPoolingModule object from inherited base classes: nn with example: obj = _PyramidSpatialPoolingModule(in_channels, down_channels, out_size, levels)