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

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

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

# glu

[common]\
fun [glu](glu.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)

`glu(input: Tensor, dim: Long = -1L)`: the `glu` operator. Gated linear unit: splits `input` in half along `dim` and gates the first half with the sigmoid of the second. The size of `dim` must be even; the output halves it.