ag_clamp: Element-wise clamp

View source: R/autograd.R

ag_clampR Documentation

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)

Value

ag_tensor


ggmlR documentation built on July 14, 2026, 1:08 a.m.