ag_clamp: Element-wise clamp
Description
Clamps values to [lo, hi]. Gradient is 1 inside the interval,
0 at the boundary (straight-through estimator).
Usage
ag_clamp(x, lo = -Inf, hi = Inf)
Arguments
- x
ag_tensor
- lo
Lower bound (default -Inf)
- hi
Upper bound (default Inf)