nn.leaky_relu
Applies the leaky rectified linear unit (Leaky ReLU) activation function element-wise to a given tensor.
The Leaky ReLU function is defined as f(x) = alpha * x if x < 0, f(x) = x otherwise, where x is the input element.
Args
inputs
(@Tensor<T>
) - A snapshot of a tensor to which the Leaky ReLU function will be applied.alpha
(@T
) - A snapshot of a fixed point scalar that defines the alpha value of the Leaky ReLU function.
Returns
A new fixed point tensor with the same shape as the input tensor and the Leaky ReLU function applied element-wise.
Type Constraints
Constrain input and output types to fixed point tensors.
Examples
Last updated