@@ -6833,6 +6833,13 @@ def elu(x, alpha=1.0, name=None):
6833
6833
6834
6834
Returns:
6835
6835
output(${out_type}): ${out_comment}
6836
+
6837
+ Examples:
6838
+
6839
+ .. code-block:: python
6840
+
6841
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6842
+ y = fluid.layers.elu(x, alpha=0.2)
6836
6843
"""
6837
6844
helper = LayerHelper ('elu' , ** locals ())
6838
6845
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6856,6 +6863,13 @@ def relu6(x, threshold=6.0, name=None):
6856
6863
6857
6864
Returns:
6858
6865
output(${out_type}): ${out_comment}
6866
+
6867
+ Examples:
6868
+
6869
+ .. code-block:: python
6870
+
6871
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6872
+ y = fluid.layers.relu6(x, threshold=6.0)
6859
6873
"""
6860
6874
helper = LayerHelper ('relu6' , ** locals ())
6861
6875
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6879,6 +6893,13 @@ def pow(x, factor=1.0, name=None):
6879
6893
6880
6894
Returns:
6881
6895
output(${out_type}): ${out_comment}
6896
+
6897
+ Examples:
6898
+
6899
+ .. code-block:: python
6900
+
6901
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6902
+ y = fluid.layers.pow(x, factor=2.0)
6882
6903
"""
6883
6904
helper = LayerHelper ('pow' , ** locals ())
6884
6905
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6903,6 +6924,13 @@ def stanh(x, scale_a=2.0 / 3.0, scale_b=1.7159, name=None):
6903
6924
6904
6925
Returns:
6905
6926
output(${out_type}): ${out_comment}
6927
+
6928
+ Examples:
6929
+
6930
+ .. code-block:: python
6931
+
6932
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6933
+ y = fluid.layers.stanh(x, scale_a=0.6667, scale_b=1.7159)
6906
6934
"""
6907
6935
helper = LayerHelper ('stanh' , ** locals ())
6908
6936
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6928,6 +6956,13 @@ def hard_sigmoid(x, slope=0.2, offset=0.5, name=None):
6928
6956
6929
6957
Returns:
6930
6958
output(${out_type}): ${out_comment}
6959
+
6960
+ Examples:
6961
+
6962
+ .. code-block:: python
6963
+
6964
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6965
+ y = fluid.layers.hard_sigmoid(x, slope=0.3, offset=0.8)
6931
6966
"""
6932
6967
helper = LayerHelper ('hard_sigmoid' , ** locals ())
6933
6968
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6952,6 +6987,13 @@ def swish(x, beta=1.0, name=None):
6952
6987
6953
6988
Returns:
6954
6989
output(${out_type}): ${out_comment}
6990
+
6991
+ Examples:
6992
+
6993
+ .. code-block:: python
6994
+
6995
+ x = fluid.layers.data(name="x", shape=[3,10,32,32], dtype="float32")
6996
+ y = fluid.layers.swish(x, beta=1.2)
6955
6997
"""
6956
6998
helper = LayerHelper ('swish' , ** locals ())
6957
6999
out = helper .create_variable_for_type_inference (dtype = x .dtype )
@@ -6988,8 +7030,8 @@ def prelu(x, mode, param_attr=None, name=None):
6988
7030
.. code-block:: python
6989
7031
6990
7032
x = fluid.layers.data(name="x", shape=[10,10], dtype="float32")
6991
- mode = 'channel'
6992
- output = fluid.layers.prelu(x,mode)
7033
+ mode = 'channel'
7034
+ output = fluid.layers.prelu(x,mode)
6993
7035
"""
6994
7036
helper = LayerHelper ('prelu' , ** locals ())
6995
7037
if mode not in ['all' , 'channel' , 'element' ]:
0 commit comments