class_docstr: The basic implementation for object context block
  Input:
      N X C X H X W
  Parameters:
      in_channels       : the dimension of the input feature map
      key_channels      : the dimension after the key/query transform
      scale             : choose the scale to downsample the input feature maps (save memory cost)
      bn_type           : specify the bn type
  Return:
      N X C X H X W
code: def __init__(self, in_channels, key_channels, scale=1, bn_type=None):
      super(_ObjectAttentionBlock, self).__init__()
      self.scale = scale
      self.in_channels = in_channels
      self.key_channels = key_channels
      self.pool = nn.MaxPool2d(kernel_size=(scale, scale))
      self.f_pixel = nn.Sequential(
          nn.Conv2d(
              in_channels=self.in_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.key_channels, bn_type=bn_type),
          nn.Conv2d(
              in_channels=self.key_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.key_channels, bn_type=bn_type),
      )
      self.f_object = nn.Sequential(
          nn.Conv2d(
              in_channels=self.in_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.key_channels, bn_type=bn_type),
          nn.Conv2d(
              in_channels=self.key_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.key_channels, bn_type=bn_type),
      )
      self.f_down = nn.Sequential(
          nn.Conv2d(
              in_channels=self.in_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.key_channels, bn_type=bn_type),
      )
      self.f_up = nn.Sequential(
          nn.Conv2d(
              in_channels=self.key_channels,
              out_channels=self.in_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          ModuleHelper.BNReLU(self.in_channels, bn_type=bn_type),
      )
  
imports: import os
  import logging
  import numpy
  import torch
  import torch.nn
  import torch._utils
  import torch.nn.functional
  from .bn_helper import BatchNorm2d, BatchNorm2d_class, relu_inplace
label_desc: Use image node_id 1 to create a new _ObjectAttentionBlock object from inherited base classes: nn with example: obj = _ObjectAttentionBlock(in_channels, key_channels, scale, bn_type)