triton.language.clamp

triton.language.clamp(x, min, max, propagate_nan: ~triton.language.core.constexpr = <PROPAGATE_NAN.NONE: 0>)

Clamps the input tensor x within the range [min, max]. Behavior when min > max is undefined.

Parameters:
  • x (Block) – the input tensor

  • min (Block) – the lower bound for clamping

  • max (Block) – the upper bound for clamping

  • propagate_nan (tl.PropagateNan) – whether to propagate NaN values. Applies only to the x tensor. If either min or max is NaN, the result is undefined.

See also

tl.PropagateNan