---
title: "ClikaRT::ops::clamp_min"
sidebar_label: "clamp_min"
description: "Elementwise lower bound. \\[ \\max(x_i,\\; \\mathrm{min}) \\] min is a scalar or a tensor broadcast against input (numpy rules). input the input tensor."
---

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

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

## clamp\_min() {#clamp_min}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`clamp_min`**([`Tensor`](../Tensor.md) `input`, [`ScalarOrTensor`](../ScalarOrTensor.md) `min`)

</div>

Elementwise lower bound.

$$
\max(x_i,\; \mathrm{min})
$$

[`min`](./min.md#min) is a scalar or a tensor broadcast against `input` (numpy rules).

**Parameters**

- `input`: the input tensor.
- `min`: the lower bound; scalar or broadcastable tensor.

**Throws**

- `ClikaRT::Error`: when a tensor bound does not broadcast against `input`, or when the dtype is not served (`code_name()` carries the reason).

**Returns:** a new tensor, same shape and dtype as `input`.

```cpp
auto y = ClikaRT::ops::clamp_min(x, 0.0);
```

<div class="api-declared">

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

</div>
