Skip to main content

ClikaRT::nn::Clamp

class

Header: ClikaRT/nn/generated/elementwise.h
Inherits: ClikaRT::nn::Module

Clamps every element of input into [min_val, max_val]; an unset bound leaves that side open. The module form of ClikaRT::ops::clamp, which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

Member functions​

Clamp(ClampOptions)​

explicit Clamp(ClampOptions options = {})

Constructs the module from options (every default when omitted).

Declared in ClikaRT/nn/generated/elementwise.h, line 427

Clamp(optional<ScalarOrTensor>, optional<ScalarOrTensor>)​

explicit Clamp(std::optional<ScalarOrTensor> min_val, std::optional<ScalarOrTensor> max_val = std::nullopt)

Clamp(min_val, max_val): the positional form of ClampOptions(min_val, max_val).

Declared in ClikaRT/nn/generated/elementwise.h, line 430

forward()​

Tensor forward(Tensor input) const

forward_impl, unwrapped: raises ClikaRT::Error on failure.

Declared in ClikaRT/nn/generated/elementwise.h, line 443

operator()()​

Tensor operator()(Tensor input) const

Same as forward.

Declared in ClikaRT/nn/generated/elementwise.h, line 447

options()​

const ClampOptions& options() const

The settings this module was constructed with.

Declared in ClikaRT/nn/generated/elementwise.h, line 451