---
title: "ClikaRT::nn::Threshold"
sidebar_label: "Threshold"
description: "Keeps every element above threshold and replaces the rest with value."
---

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

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

**Header:** `ClikaRT/nn/generated/activation.h`  
**Inherits:** [`ClikaRT::nn::Module`](./Module.md)

Keeps every element above threshold and replaces the rest with value. The module form of [`ClikaRT::ops::threshold`](../ops/threshold.md#threshold), which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

## Member functions

### Threshold(ThresholdOptions) {#Threshold}

<div class="api-signature">

`explicit` **`Threshold`**([`ThresholdOptions`](./ThresholdOptions.md) `options`)

</div>

Constructs the module from [`options`](./Threshold.md#options).

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1115

</div>

### Threshold(double, double) {#Threshold-2}

<div class="api-signature">

`explicit` **`Threshold`**(`double` `threshold`, `double` `value`)

</div>

`Threshold(threshold, value)`: the positional form of `ThresholdOptions(threshold, value)`.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1118

</div>

### forward() {#forward}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`forward`**([`Tensor`](../Tensor.md) `input`) `const`

</div>

[`forward_impl`](./Threshold.md#forward), unwrapped: raises [`ClikaRT::Error`](../Error.md) on failure.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1138

</div>

### operator()() {#operator-call}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`operator()`**([`Tensor`](../Tensor.md) `input`) `const`

</div>

Same as [`forward`](./Threshold.md#forward).

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1142

</div>

### options() {#options}

<div class="api-signature">

`const` [`ThresholdOptions`](./ThresholdOptions.md)`&` **`options`**() `const`

</div>

The settings this module was constructed with.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1146

</div>
