---
title: "ClikaRT::ops::elu"
sidebar_label: "elu"
description: "Exponential linear unit. \\[ \\mathrm{elu}(x) = \\begin{cases} \\mathrm{scale}\\cdot x & x > 0 \\\\ \\mathrm{scale}\\cdot\\alpha\\,(e^{\\,\\mathrm{input\\_scale}\\cdot x}-1) & x \\le 0 \\end{cases} \\] Elementwise; inp…"
---

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

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

## elu() {#elu}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`elu`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `alpha` `=` `1.0`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `scale` `=` `1.0`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `input_scale` `=` `1.0`<br />
)

</div>

Exponential linear unit.

$$
\mathrm{elu}(x) = \begin{cases} \mathrm{scale}\cdot x & x > 0 \\ \mathrm{scale}\cdot\alpha\,(e^{\,\mathrm{input\_scale}\cdot x}-1) & x \le 0 \end{cases}
$$

Elementwise; `input_scale` feeds only the exponential's argument.

**Parameters**

- `input`: the input tensor.
- `alpha`: the negative-side saturation value. Default `1.0`.
- `scale`: multiplies the whole result. Default `1.0`.
- `input_scale`: scales the exponent on the negative side. Default `1.0`.

**Throws**

- `ClikaRT::Error`: when the input's dtype is not served for this operation (the machine-readable reason rides `code_name()`).

**Returns:** a new tensor, same shape and dtype as `input`.

```cpp
auto y = ClikaRT::ops::elu(x);            // standard ELU
auto s = ClikaRT::ops::elu(x, 1.67, 1.05); // SELU-shaped constants
```

<div class="api-declared">

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

</div>
