code: def set_derived_configs(self):
      input_dim = self.descriptors["input"]["dim"]
  
      if not (
          (
              self.config["height"] > 0
              and self.config["height-in"] == -1
              and self.config["height-out"] == -1
          )
          or (
              self.config["height-out"] > 0
              and self.config["height-in"] > 0
          )
      ):
          raise RuntimeError(
              "You must specify height, or height-in and height-out, for res2-block."
          )
  
      if not (
          self.config["height-in"] > 0 and self.config["height-out"] > 0
      ):
          height = self.config["height"]
          if not height > 0:
              raise RuntimeError(
                  "You must specify either height, or height-in and height-out, for "
                  "res2-block."
              )
          self.config["height-in"] = height
          self.config["height-out"] = height
  
      height_in = self.config["height-in"]
      if input_dim % height_in != 0:
          raise RuntimeError(
              "Specified input image height {0} does not "
              "divide the input dim {1}".format(height_in, input_dim)
          )
          self.config["num-filters"] = input_dim / height
  
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 3 for calling the XconfigRes2Block obj's underlying member method code with example usage: obj.set_derived_configs() without return types