Skip to main content

ClikaRT::ops::clamp_min

function

clamp_min()

Tensor clamp_min(Tensor x, ScalarOrTensor min)

Elementwise lower bound.

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

min is a scalar or a tensor broadcast against x (numpy rules).

Parameters

  • x: the input tensor.
  • min: the lower bound; scalar or broadcastable tensor.

Throws

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

Returns: a new tensor, same shape and dtype as x.

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

Declared in ClikaRT/compute/ops.h, line 4788