class_docstr: Helper class for constructing residual blocks.
code: def add_simple_block(
      self,
      input_filters,
      num_filters,
      down_sampling=False,
      spatial_batch_norm=True,
  ):
      self.comp_idx = 0
      shortcut_blob = self.prev_blob
  
      # 3x3
      self.add_conv(
          input_filters,
          num_filters,
          kernel=3,
          stride=(1 if down_sampling is False else 2),
          pad=1,
      )
  
      if spatial_batch_norm:
          self.add_spatial_bn(num_filters)
      self.add_relu()
  
      last_conv = self.add_conv(
          num_filters, num_filters, kernel=3, pad=1
      )
      if spatial_batch_norm:
          last_conv = self.add_spatial_bn(num_filters)
  
      # Increase of dimensions, need a projection for the shortcut
      if num_filters != input_filters:
          shortcut_blob = brew.conv(
              self.model,
              shortcut_blob,
              "shortcut_projection_%d" % self.comp_count,
              input_filters,
              num_filters,
              weight_init=("MSRAFill", {}),
              kernel=1,
              stride=(1 if down_sampling is False else 2),
              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,
                  num_filters,
                  epsilon=1e-3,
                  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
  
file_path: pytorch/caffe2/python/models/resnet.py
imports: from caffe2.python import brew
  import logging
label_desc: Use image node_id 6 for calling the ResNetBuilder obj's underlying member method code with example usage: obj.add_simple_block(input_filters, num_filters, down_sampling, spatial_batch_norm) without return types