code: def _compute_threshold(x):
      """
      ref: https://github.com/XJTUWYD/TWN
      Computing the threshold.
      """
      x_sum = tf.reduce_sum(
          input_tensor=tf.abs(x), axis=None, keepdims=False, name=None
      )
      # threshold = tf.compat.v1.div(x_sum, tf.cast(tf.size(input=x), tf.float32), name=None)
      threshold = tf.math.divide(
          x_sum, tf.cast(tf.size(input=x), tf.float32), name=None
      )
      threshold = tf.multiply(0.7, threshold, name=None)
      return threshold
  
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 23 for calling a global function with example usage: _compute_threshold(x) and returns: threshold