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

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

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

# clampInPlace

[common]\
fun [clampInPlace](clampInPlace.md)(self: [Tensor](../Tensor/index.md), min: [Tensor](../Tensor/index.md)? = null, max: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)

`clampInPlace(self: Tensor, min: Tensor? = null, max: Tensor? = null)`: the `clamp_` operator. In-place `clamp`: writes the result through `self`; same formula, arguments, and error conditions as `clamp()`. Either bound may be absent (`std::nullopt`), a one-sided clamp; tensor bounds broadcast against `self`. 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.