paddle.fluid.layers.nn. elu ( x, alpha=1.0, name=None ) [source]

Warning: API “paddle.fluid.layers.nn.elu” is deprecated since 2.0.0, and will be removed in future versions. Please use “paddle.nn.functional.elu” instead.


paddle.nn.functional.elu :alias: paddle.nn.functional.elu,paddle.nn.functional.activation.elu :old_api: paddle.fluid.layers.elu

${comment} Args:

System Message: ERROR/3 (/usr/local/lib/python3.8/site-packages/paddle/fluid/layers/nn.py:docstring of paddle.fluid.layers.nn.elu, line 9)

Unexpected indentation.

x(${x_type}): ${x_comment} alpha(${alpha_type}|1.0): ${alpha_comment} name(str|None): The default value is None. Normally there is no need for user to set this property.

System Message: ERROR/3 (/usr/local/lib/python3.8/site-packages/paddle/fluid/layers/nn.py:docstring of paddle.fluid.layers.nn.elu, line 12)

Unexpected indentation.

For more information, please refer to Name.

System Message: WARNING/2 (/usr/local/lib/python3.8/site-packages/paddle/fluid/layers/nn.py:docstring of paddle.fluid.layers.nn.elu, line 13)

Block quote ends without a blank line; unexpected unindent.


${out_type}: ${out_comment}


import paddle.fluid as fluid
import numpy as np

input_elu = np.array([[-1,6],[1,15.6]])
with fluid.dygraph.guard():
    x = fluid.dygraph.to_variable(input_elu)
    y = fluid.layers.elu(x, alpha=0.2)
    # [[-0.12642411  6.        ]
    # [ 1.          15.6       ]]