class_docstr: Make a OCR used SelfAttentionBlock.
class_docstr_tok: ["Make","a","OCR","used","SelfAttentionBlock","."]
code: def __init__(
      self, in_channels, channels, scale, conv_cfg, norm_cfg, act_cfg
  ):
      if scale > 1:
          query_downsample = nn.MaxPool2d(kernel_size=scale)
      else:
          query_downsample = None
      super(ObjectAttentionBlock, self).__init__(
          key_in_channels=in_channels,
          query_in_channels=in_channels,
          channels=channels,
          out_channels=in_channels,
          share_key_query=False,
          query_downsample=query_downsample,
          key_downsample=None,
          key_query_num_convs=2,
          key_query_norm=True,
          value_out_num_convs=1,
          value_out_norm=True,
          matmul_norm=True,
          with_out=True,
          conv_cfg=conv_cfg,
          norm_cfg=norm_cfg,
          act_cfg=act_cfg,
      )
      self.bottleneck = ConvModule(
          in_channels * 2,
          in_channels,
          1,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/decode_heads/ocr_head.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from annotator.uniformer.mmcv.cnn import ConvModule
  from annotator.uniformer.mmseg.ops import resize
  from ..builder import HEADS
  from ..utils import SelfAttentionBlock
  from .cascade_decode_head import BaseCascadeDecodeHead
label_desc: Use image node_id 1 to create a new ObjectAttentionBlock object from inherited base classes: _SelfAttentionBlock with example: obj = ObjectAttentionBlock(in_channels, channels, scale, conv_cfg, norm_cfg, act_cfg)