Clips tensor values to a maximum average L2-norm. (deprecated)
tf.compat.v1.clip_by_average_norm( t, clip_norm, name=None )
Given a tensor
t, and a maximum clip value
clip_norm, this operation normalizes
t so that its average L2-norm is less than or equal to
clip_norm. Specifically, if the average L2-norm is already less than or equal to
t is not modified. If the average L2-norm is greater than
clip_norm, then this operation returns a tensor of the same type and shape as
t with its values set to:
t * clip_norm / l2norm_avg(t)
In this case, the average L2-norm of the output tensor is
This operation is typically used to clip gradients before applying them with an optimizer.
| || A |
| || A 0-D (scalar) |
| ||A name for the operation (optional).|
| A clipped |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.