---
title: "swiglu"
sidebar_label: "swiglu"
description: "Kotlin binding reference: swiglu."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[swiglu](swiglu.md)

# swiglu

[common]\
fun [swiglu](swiglu.md)(input: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, limit: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = Double.POSITIVE_INFINITY): [Tensor](../Tensor/index.md)

`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.