code: def _generate_bottleneck_resblock_config(self):
      configs = []
  
      name = self.name
      num_bottleneck_filters = self.config["num-bottleneck-filters"]
      assert num_bottleneck_filters > 0
      input_dim = self.descriptors["input"]["dim"]
      height_in = self.config["height-in"]
      height_out = self.config["height-out"]
      input_descriptor = self.descriptors["input"]["final-string"]
      allow_zero_padding = self.config["allow-zero-padding"]
      time_period_out = self.config["time-period"]
      if not input_dim % height_in == 0:
          raise RuntimeError(
              "input-dim={0} does not divide height-in={1}".format(
                  input_dim, height_in
              )
          )
      num_filters_in = input_dim / height_in
      num_filters_out = self.config["num-filters"]
  
      if height_out != height_in:
          if (
              height_out < height_in / 2 - 1
              or height_out > height_in / 2 + 1
          ):
              raise RuntimeError(
                  "Expected height-out to be about half height-in, or the same: "
                  "height-in={0} height-out={1}".format(
                      height_in, height_out
                  )
              )
          height_subsample = 2
      else:
          height_subsample = 1
  
      cur_descriptor = input_descriptor
      cur_num_filters = num_filters_in
      cur_height = height_in
      if height_subsample == 1 and num_filters_in == num_filters_out:
          bypass_descriptor = input_descriptor
      else:
          bypass_descriptor = "{0}.conv_bypass".format(name)
  
      # get miscellaneous convolution options passed in from the xconfig line
      a = []
      for opt_name in [
          "param-stddev",
          "bias-stddev",
          "use-natural-gradient",
          "max-change",
          "rank-in",
          "rank-out",
          "num-minibatches-history",
          "alpha-in",
          "alpha-out",
          "l2-regularize",
      ]:
          value = self.config[opt_name]
          if value != "":
              a.append("{0}={1}".format(opt_name, value))
      misc_conv_opts = " ".join(a)
  
      for n in [1, 2, 3]:
          # the convolution.
          height_offsets = "-1,0,1" if n == 2 else "0"
          this_height_subsample = height_subsample if n == 1 else 1
          time_offsets = (
              "-{t},0,{t}".format(t=time_period_out) if n == 2 else "0"
          )
          next_num_filters = (
              num_filters_out if n == 3 else num_bottleneck_filters
          )
  
          conv_opts = (
              "height-in={h_in} height-out={h_out} height-offsets={ho} time-offsets={to} "
              "num-filters-in={fi} num-filters-out={fo} height-subsample-out={hs} "
              "{r} {o}".format(
                  h_in=cur_height,
                  h_out=height_out,
                  to=time_offsets,
                  ho=height_offsets,
                  hs=this_height_subsample,
                  fi=cur_num_filters,
                  fo=next_num_filters,
                  r=(
                      "required-time-offsets=0"
                      if allow_zero_padding
                      else ""
                  ),
                  o=misc_conv_opts,
              )
          )
  
          configs.append(
              "component name={0}.conv{1} type=TimeHeightConvolutionComponent "
              "{2}".format(name, n, conv_opts)
          )
          configs.append(
              "component-node name={0}.conv{1} component={0}.conv{1} "
              "input={2}".format(name, n, cur_descriptor)
          )
  
          cur_num_filters = next_num_filters
          cur_height = height_out
          cur_descriptor = "{0}.conv{1}".format(name, n)
  
          # the batch-norm
          configs.append(
              "component name={0}.batchnorm{1}  type=BatchNormComponent dim={2} "
              "block-dim={3}".format(
                  name, n, cur_num_filters * cur_height, cur_num_filters
              )
          )
          configs.append(
              "component-node name={0}.batchnorm{1} component={0}.batchnorm{1} "
              "input={2}".format(name, n, cur_descriptor)
          )
          cur_descriptor = "{0}.batchnorm{1}".format(name, n)
  
          # the scale and offset
          configs.append(
              "component name={0}.scaleoffset{1}  type=ScaleAndOffsetComponent dim={2} "
              "block-dim={3}".format(
                  name, n, cur_num_filters * cur_height, cur_num_filters
              )
          )
          configs.append(
              "component-node name={0}.scaleoffset{1} component={0}.scaleoffset{1} "
              "input={2}".format(name, n, cur_descriptor)
          )
          cur_descriptor = "{0}.scaleoffset{1}".format(name, n)
  
          if n == 3:
              # the bypass connection
              cur_descriptor = "Sum({0}, {1})".format(
                  cur_descriptor, bypass_descriptor
              )
  
          # the ReLU
          configs.append(
              "component name={0}.relu{1} type=RectifiedLinearComponent "
              "dim={2} block-dim={3} self-repair-scale={4} "
              "self-repair-lower-threshold={5}".format(
                  name,
                  n,
                  cur_num_filters * cur_height,
                  cur_num_filters,
                  self.config["self-repair-scale"],
                  self.config[
                      "self-repair-lower-threshold{0}".format(n)
                  ],
              )
          )
          configs.append(
              "component-node name={0}.relu{1} component={0}.relu{1} "
              "input={2}".format(name, n, cur_descriptor)
          )
  
          cur_descriptor = "{0}.relu{1}".format(name, n)
  
      if bypass_descriptor != input_descriptor:
          # We need to add the 1x1 bypass convolution because we're either doing height
          # subsampling or changing the number of filters.
          conv_opts = (
              "height-in={hi} height-out={ho} height-offsets=0 "
              "time-offsets=0 height-subsample-out={hs} "
              "num-filters-in={fi} num-filters-out={fo} {o}".format(
                  hi=height_in,
                  ho=height_out,
                  hs=height_subsample,
                  fi=num_filters_in,
                  fo=num_filters_out,
                  o=misc_conv_opts,
              )
          )
          configs.append(
              "component name={0}.conv_bypass type=TimeHeightConvolutionComponent "
              "{1}".format(name, conv_opts)
          )
          configs.append(
              "component-node name={0}.conv_bypass component={0}.conv_bypass "
              "input={1}".format(name, input_descriptor)
          )
  
      # Note: the function 'output_name' is responsible for returning the
      # descriptor corresponding to the output of the network, which
      # in this case will be '{0}.relu3'.format(name).
      return configs
  
imports: from __future__ import print_function
  from __future__ import division
  import math
  import re
  import sys
  from libs.nnet3.xconfig.basic_layers import XconfigLayerBase
label_desc: Use image node_id 10 for calling the XconfigRes2Block obj's underlying member method code with example usage: obj._generate_bottleneck_resblock_config() and returns: configs