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

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

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

# clampMax

[common]\
fun [clampMax](clampMax.md)(input: [Tensor](../Tensor/index.md), max: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`clampMax(input: Tensor, max: Tensor)`: the `clamp_max` operator. Elementwise upper bound. `max` is a scalar or a tensor broadcast against `input` (numpy rules).

[common]\
fun [clampMax](clampMax.md)(input: [Tensor](../Tensor/index.md), max: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)

`clampMax(input: Tensor, max: Double)`: the number form of `clamp_max`, `max` as a scalar.