Skip to main content

ClikaRT::ops::prelu

function

prelu()​

Tensor prelu(Tensor input, OptionalTensor weight = {})

Parametric ReLU: a learned negative-side slope.

prelu(x)={xx>0w⋅xx≤0\mathrm{prelu}(x) = \begin{cases} x & x > 0 \\ w \cdot x & x \le 0 \end{cases}

weight is a scalar or a per-channel tensor broadcast against input.

Parameters

  • input: the input tensor.
  • weight: the negative-slope tensor (scalar or per-channel). Absent uses the weight held by the bound primitive (module usage).

Throws

  • ClikaRT::Error: when weight's shape 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.

auto y = ClikaRT::ops::prelu(x, slopes); // slopes: [C] or scalar

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