prelu#

ivy.prelu(x, slope, /, *, out=None)[source]#

Prelu takes input data (Array) and slope array as input,

and produces one output data (array) where the function f(x) = slope * x for x < 0, f(x) = x for x >= 0., is applied to the data array elementwise. This operator supports unidirectional broadcasting (array slope should be unidirectional broadcastable to input tensor X);

Parameters:
  • x (Union[NativeArray, Array]) – Input Array.

  • slope (Union[float, NativeArray, Array]) – Slope Array. The shape of slope can be smaller then first input X; if so, its shape must be unidirectional broadcastable to X.

  • out (Optional[Array], default: None) – Optional output array.

Return type:

Array

Returns:

ret – Array containing Parametrized relu values.

Array.prelu(self, slope, /, *, out=None)[source]#

Prelu takes input data (Array) and slope array as input,

and produces one output data (array) where the function f(x) = slope * x for x < 0, f(x) = x for x >= 0., is applied to the data array elementwise. This operator supports unidirectional broadcasting (array slope should be unidirectional broadcastable to input tensor X);

Parameters:
  • self – input array.

  • slope (Union[float, NativeArray, Array]) – Slope Array. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X.

  • out (Optional[Array], default: None) – Optional output array.

Return type:

Array

Returns:

ret – input array with prelu applied elementwise.

Container.prelu(self, slope, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#
Parameters:
  • slope (Union[float, NativeArray, Array, Container]) –

  • key_chains (Optional[Union[List[str], Dict[str, str], Container]], default: None) –

  • to_apply (Union[bool, Container], default: True) –

  • prune_unapplied (Union[bool, Container], default: False) –

  • map_sequences (Union[bool, Container], default: False) –

  • out (Optional[Container], default: None) –

Return type:

Container