jax.lax.clamp

Contents

jax.lax.clamp#

jax.lax.clamp(min, x, max)[source]#

Elementwise clamp.

Returns \(\mathrm{clamp}(x) = \begin{cases} \mathit{min} & \text{if } x < \mathit{min},\\ \mathit{max} & \text{if } x > \mathit{max},\\ x & \text{otherwise} \end{cases}\).

Parameters:
Return type:

Array