Clips values element-wise. max(min(x, clipValueMax), clipValueMin)
max(min(x, clipValueMax), clipValueMin)
const x = tf.tensor1d([-1, 2, -3, 4]);x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) Copy
const x = tf.tensor1d([-1, 2, -3, 4]);x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3)
The input tensor.
Lower bound of range to be clipped to.
Upper bound of range to be clipped to.
Clips values element-wise.
max(min(x, clipValueMax), clipValueMin)