Skip to main content

ClikaRT::ops::hardsigmoid

function

hardsigmoid()​

Tensor hardsigmoid(Tensor input)

Piecewise-linear sigmoid approximation.

hardsigmoid(x)=clamp ⁣(x6+12,  0,  1)\mathrm{hardsigmoid}(x) = \mathrm{clamp}\!\bigl(\tfrac{x}{6} + \tfrac{1}{2},\; 0,\; 1\bigr)

Throws

  • ClikaRT::Error: when the input's dtype is not served for this operation (the machine-readable reason rides code_name()).

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

auto y = ClikaRT::ops::hardsigmoid(x);

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