---
title: "ClikaRT::ops::relu"
sidebar_label: "relu"
description: "Rectified linear unit. \\[ \\mathrm{relu}(x) = \\max(0, x) \\] ClikaRT::Error when the input's dtype is not served for this operation (the machine-readable reason rides code_name())."
---

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

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

## relu() {#relu}

<div class="api-signature">

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

</div>

Rectified linear unit.

$$
\mathrm{relu}(x) = \max(0, x)
$$

**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::relu(x);
```

<div class="api-declared">

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

</div>
