relu6

paddle.fluid.layers.nn. relu6 ( x, threshold=6.0, name=None ) [source]

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

${comment}

Args:

x(${x_type}): ${x_comment} threshold(float, optional): ${threshold_comment} name(str, optional): The default value is None. Normally there is no

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

Unexpected indentation.

need for user to set this property. For more information, please refer to Name.

Returns:

output(${out_type}): ${out_comment}

Examples:

import paddle.fluid as fluid
import numpy as np
in1 = np.array([[-1,0],[2.5,7.8]])
with fluid.dygraph.guard():
    x1 = fluid.dygraph.to_variable(in1)
    out1 = fluid.layers.relu6(x=x1, threshold=6.0)
    print(out1.numpy())
    # [[0.  0. ]
    #  [2.5 6. ]]