---
title: "ClikaRT::ops::hardtanh_"
sidebar_label: "hardtanh_"
description: "In-place hardtanh: writes the result through self; same formula, arguments, and error conditions as hardtanh(). A view input writes through its base storage."
---

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

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

## hardtanh\_() {#hardtanh_}

<div class="api-signature">

[`Tensor`](../Tensor.md)`&` **`hardtanh_`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md)`&` `self`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `min_val` `=` `-1.0`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `max_val` `=` `1.0`<br />
)

</div>

In-place [`hardtanh`](./hardtanh.md#hardtanh): writes the result through `self`; same formula, arguments, and error conditions as [`hardtanh()`](./hardtanh.md#hardtanh). A view input writes through its base storage. Returns `self` under the value surface, [`Result`](../Result.md)`<void>` under the [`Result`](../Result.md) surface; [`CLIKART_CHECK`](../../index.md#CLIKART_CHECK) is the mode-stable spelling.

<div class="api-declared">

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

</div>
