Skip to content
fn

leaky_relu_

→Tensor
leaky_relu_(input: Tensor, negative_slope: float = 0.01, inplace: bool = True)

In-place Leaky ReLU — overwrites input with the leaky-rectified result.

yi={xixi≥0negative_slope⋅xixi<0y_i = \begin{cases} x_i & x_i \ge 0 \\ \text{negative\_slope} \cdot x_i & x_i < 0 \end{cases}

Parameters

inputTensor
Input; modified in place.
negative_slopefloat= 0.01
Slope applied to the negative side. Default 0.01.
inplacebool= True
False returns leaky_relu's fresh result instead. Default True.

Returns

Tensor

The same input tensor, now holding leaky_relu(input, negative_slope).

Used by 1