Skip to main content
Ctrl+K

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:
  • min (Union[Array, ndarray, bool_, number, bool, int, float, complex]) –

  • x (Union[Array, ndarray, bool_, number, bool, int, float, complex]) –

  • max (Union[Array, ndarray, bool_, number, bool, int, float, complex]) –

Return type:

Array

previous

jax.lax.ceil

next

jax.lax.clz