---
title: "hardtanhInPlace"
sidebar_label: "hardtanhInPlace"
description: "Kotlin binding reference: hardtanhInPlace."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[hardtanhInPlace](hardtanhInPlace.md)

# hardtanhInPlace

[common]\
fun [hardtanhInPlace](hardtanhInPlace.md)(self: [Tensor](../Tensor/index.md), minVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = -1.0, maxVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)

`hardtanhInPlace(self: Tensor, minVal: Double = -1.0, maxVal: Double = 1.0)`: the `hardtanh_` operator. In-place `hardtanh`: writes the result through `self`; same formula, arguments, and error conditions as `hardtanh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.