code: def detectMinVal(
      input_mat, var, threshold=1e-6, name="", debug=False
  ):
      eigen_min = tf.reduce_min(input_mat)
      eigen_max = tf.reduce_max(input_mat)
      eigen_ratio = eigen_max / eigen_min
      input_mat_clipped = clipoutNeg(input_mat, threshold)
  
      if debug:
          input_mat_clipped = tf.cond(
              tf.logical_or(
                  tf.greater(eigen_ratio, 0.0),
                  tf.less(eigen_ratio, -500),
              ),
              lambda: input_mat_clipped,
              lambda: tf.Print(
                  input_mat_clipped,
                  [
                      tf.convert_to_tensor(
                          "screwed ratio " + name + " eigen values!!!"
                      ),
                      tf.convert_to_tensor(var.name),
                      eigen_min,
                      eigen_max,
                      eigen_ratio,
                  ],
              ),
          )
  
      return input_mat_clipped
  
imports: import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: detectMinVal(input_mat, var, threshold, name, debug) and returns: input_mat_clipped