code: def compute_alpha(x):
      """Computing the scale parameter."""
      threshold = _compute_threshold(x)
      alpha1_temp1 = tf.where(
          tf.greater(x, threshold), x, tf.zeros_like(x, tf.float32)
      )
      alpha1_temp2 = tf.where(
          tf.less(x, -threshold), x, tf.zeros_like(x, tf.float32)
      )
      alpha_array = tf.add(alpha1_temp1, alpha1_temp2, name=None)
      alpha_array_abs = tf.abs(alpha_array)
      alpha_array_abs1 = tf.where(
          tf.greater(alpha_array_abs, 0),
          tf.ones_like(alpha_array_abs, tf.float32),
          tf.zeros_like(alpha_array_abs, tf.float32),
      )
      alpha_sum = tf.reduce_sum(input_tensor=alpha_array_abs)
      n = tf.reduce_sum(input_tensor=alpha_array_abs1)
      # alpha = tf.compat.v1.div(alpha_sum, n)
      alpha = tf.math.divide(alpha_sum, n)
      return alpha
  
imports: import numpy
  import tensorflow
  from tensorflow.python.ops.rnn_cell import LSTMStateTuple
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated, deprecated_alias
label_desc: Use image node_id 2 for calling a global function with example usage: compute_alpha(x) and returns: alpha