---
title: "ClikaRT::ops::reglu"
sidebar_label: "reglu"
description: "ReGLU gated activation over a concatenated gate‖up input. \\[ \\mathrm{reglu}(x)_{\\ldots,j} = \\mathrm{relu}(a_{\\ldots,j})\\cdot b_{\\ldots,j},\\qquad x = [\\,a \\,\\|\\, b\\,] \\text{ along the last dim} \\] The…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## reglu() {#reglu}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`reglu`**([`Tensor`](../Tensor.md) `input`)

</div>

ReGLU gated activation over a concatenated gate‖up input.

$$
\mathrm{reglu}(x)_{\ldots,j} = \mathrm{relu}(a_{\ldots,j})\cdot b_{\ldots,j},\qquad x = [\,a \,\|\, b\,] \text{ along the last dim}
$$

The relu-gated member of the GLU family, beside [`geglu`](./geglu.md#geglu) / [`swiglu`](./swiglu.md#swiglu): `[.., 2d]` in, `[.., d]` out; the last dim must be even.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when the last dim is odd (`code_name()` carries the reason).

**Returns:** the gated tensor `[.., d]`.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 763

</div>
