Python wrappers
Public Python APIs implemented by this engine symbol.Element-wise clamp — returns a clipped to the range [min_v, max_v] with a fully wired autograd node.
Math
Shape
Output shape equals input shape (elementwise).
See Also
ClipBackward.
Parameters
aTensorImplPtrInput tensor (integer or floating-point).
min_vdoubleLower clamp bound.
max_vdoubleUpper clamp bound (must satisfy
min_v <= max_v).Returns
TensorImplPtrClamped output tensor with the same shape, dtype, and device as a. Gradient is g where min_v < a < max_v and zero where a saturates either bound.
Notes
Equivalent to reference framework's clamp (Lucid uses the name
clip for the canonical op). Saturated positions act as gradient
stoppers — useful for hard-tanh-style activations.