MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / _compute_threshold

Function _compute_threshold

tensorlayer/layers/utils.py:419–428  ·  view source on GitHub ↗

ref: https://github.com/XJTUWYD/TWN Computing the threshold.

(x)

Source from the content-addressed store, hash-verified

417
418
419def _compute_threshold(x):
420 """
421 ref: https://github.com/XJTUWYD/TWN
422 Computing the threshold.
423 """
424 x_sum = tf.reduce_sum(input_tensor=tf.abs(x), axis=None, keepdims=False, name=None)
425 # threshold = tf.compat.v1.div(x_sum, tf.cast(tf.size(input=x), tf.float32), name=None)
426 threshold = tf.math.divide(x_sum, tf.cast(tf.size(input=x), tf.float32), name=None)
427 threshold = tf.multiply(0.7, threshold, name=None)
428 return threshold

Callers 2

compute_alphaFunction · 0.85
ternary_operationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…