Skip to main content

//clika-runtime/io.clika.runtime/Ops/swiglu

swiglu

[common]
fun swiglu(input: Tensor, alpha: Double = 1.0, beta: Double = 0.0, limit: Double = Double.POSITIVE_INFINITY): Tensor

swiglu(input: Tensor, alpha: Double = 1.0, beta: Double = 0.0, limit: Double = Double.POSITIVE_INFINITY): the swiglu operator. SwiGLU over a concatenated [*, 2d] gate‖up input → [*, d], the clamped gated form: out = (clamp(up, ±limit) + beta) · G · sigmoid(alpha·G) with G = min(gate, limit). The defaults reduce exactly to the plain silu(gate) · up. The last dim must be even.