class_docstr: Base-OC
class_docstr_tok: ["Base-OC"]
code: def __init__(
      self,
      in_channels,
      out_channels,
      key_channels,
      value_channels,
      scales=None,
      norm_layer=nn.BatchNorm2d,
      concat=True,
      **kwargs,
  ):
      if scales is None:
          scales = [1]
      super(BaseOCModule, self).__init__()
      self.stages = nn.ModuleList(
          [
              BaseAttentionBlock(
                  in_channels,
                  out_channels,
                  key_channels,
                  value_channels,
                  scale,
                  norm_layer,
                  **kwargs,
              )
              for scale in scales
          ]
      )
      in_channels = in_channels * 2 if concat else in_channels
      self.project = nn.Sequential(
          nn.Conv2d(in_channels, out_channels, 1),
          norm_layer(out_channels),
          nn.ReLU(True),
          nn.Dropout2d(0.05),
      )
      self.concat = concat
  
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 BaseOCModule object from inherited base classes: nn with example: obj = BaseOCModule(in_channels, out_channels, key_channels, value_channels, scales, norm_layer, concat)