class_docstr: Helper class for constructing residual blocks.
code: def add_bottleneck(
      self,
      input_filters,  # num of feature maps from preceding layer
      base_filters,  # num of filters internally in the component
      output_filters,  # num of feature maps to output
      stride=1,
      group=1,
      spatial_batch_norm=True,
  ):
      self.comp_idx = 0
      shortcut_blob = self.prev_blob
  
      # 1x1
      self.add_conv(
          input_filters,
          base_filters,
          kernel=1,
          stride=1,
      )
  
      if spatial_batch_norm:
          self.add_spatial_bn(base_filters)
  
      self.add_relu()
  
      # 3x3 (note the pad, required for keeping dimensions)
      self.add_conv(
          base_filters,
          base_filters,
          kernel=3,
          stride=stride,
          group=group,
          pad=1,
      )
  
      if spatial_batch_norm:
          self.add_spatial_bn(base_filters)
      self.add_relu()
  
      # 1x1
      last_conv = self.add_conv(base_filters, output_filters, kernel=1)
      if spatial_batch_norm:
          last_conv = self.add_spatial_bn(output_filters)
  
      # Summation with input signal (shortcut)
      # When the number of feature maps mismatch between the input
      # and output (this usually happens when the residual stage
      # changes), we need to do a projection for the short cut
      if output_filters != input_filters:
          shortcut_blob = brew.conv(
              self.model,
              shortcut_blob,
              "shortcut_projection_%d" % self.comp_count,
              input_filters,
              output_filters,
              weight_init=("MSRAFill", {}),
              kernel=1,
              stride=stride,
              no_bias=self.no_bias,
          )
          if spatial_batch_norm:
              shortcut_blob = brew.spatial_bn(
                  self.model,
                  shortcut_blob,
                  "shortcut_projection_%d_spatbn" % self.comp_count,
                  output_filters,
                  epsilon=self.bn_epsilon,
                  momentum=self.bn_momentum,
                  is_test=self.is_test,
              )
  
      self.prev_blob = brew.sum(
          self.model,
          [shortcut_blob, last_conv],
          "comp_%d_sum_%d" % (self.comp_count, self.comp_idx),
      )
      self.comp_idx += 1
      self.add_relu()
  
      # Keep track of number of high level components if this ResNetBuilder
      self.comp_count += 1
  
      return output_filters
  
file_path: pytorch/caffe2/python/models/resnet.py
imports: from caffe2.python import brew
  import logging
label_desc: Use image node_id 5 for calling the ResNetBuilder obj's underlying member method code with example usage: obj.add_bottleneck(input_filters, base_filters, output_filters, stride, group, spatial_batch_norm) and returns: output_filters