class_docstr: Pyramid-OC
class_docstr_tok: ["Pyramid-OC"]
code: def __init__(
      self,
      in_channels,
      out_channels,
      key_channels,
      value_channels,
      scales=None,
      norm_layer=nn.BatchNorm2d,
      **kwargs,
  ):
      if scales is None:
          scales = [1]
      super(PyramidOCModule, self).__init__()
      self.stages = nn.ModuleList(
          [
              PyramidAttentionBlock(
                  in_channels,
                  out_channels,
                  key_channels,
                  value_channels,
                  scale,
                  norm_layer,
                  **kwargs,
              )
              for scale in scales
          ]
      )
      self.up_dr = nn.Sequential(
          nn.Conv2d(in_channels, in_channels * len(scales), 1),
          norm_layer(in_channels * len(scales)),
          nn.ReLU(True),
      )
      self.project = nn.Sequential(
          nn.Conv2d(in_channels * len(scales) * 2, out_channels, 1),
          norm_layer(out_channels),
          nn.ReLU(True),
          nn.Dropout2d(0.05),
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from pywick.models.segmentation.da_basenets.segbase import SegBaseModel
  from pywick.models.segmentation.da_basenets.fcn import _FCNHead
label_desc: Use image node_id 1 to create a new PyramidOCModule object from inherited base classes: nn with example: obj = PyramidOCModule(in_channels, out_channels, key_channels, value_channels, scales, norm_layer)