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 (Any) –

  • x (Any) –

  • max (Any) –

Return type

Any