clamp#
- class brainunit.lax.clamp(min, x, max, **kwargs)#
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}\).
- Return type:
saiunit.Quantity |
Array