未验证 提交 2fc32b17 编写于 作者: J jerrywgz 提交者: GitHub

Merge pull request #14503 from jerrywgz/api_doc

refine prelu api doc
...@@ -6972,18 +6972,18 @@ def prelu(x, mode, param_attr=None, name=None): ...@@ -6972,18 +6972,18 @@ def prelu(x, mode, param_attr=None, name=None):
""" """
Equation: Equation:
y = \max(0, x) + alpha \min(0, x) y = \max(0, x) + alpha * \min(0, x)
Args: Args:
x (Variable): The input tensor. x (Variable): The input tensor.
param_attr(ParamAttr|None): The parameter attribute for the learnable param_attr(ParamAttr|None): The parameter attribute for the learnable
weight (alpha). weight (alpha).
mode (string): The mode for weight sharing mode (string): The mode for weight sharing. It supports all, channel
all: all elements share same weight and element. all: all elements share same weight
channel:elements in a channel share same weight channel:elements in a channel share same weight
element:each element has a weight element:each element has a weight
name(str|None): A name for this layer(optional). If set None, the layer name(str|None): A name for this layer(optional). If set None, the layer
will be named automatically. will be named automatically.
Returns: Returns:
Variable: The output tensor with the same shape as input. Variable: The output tensor with the same shape as input.
...@@ -6992,7 +6992,7 @@ def prelu(x, mode, param_attr=None, name=None): ...@@ -6992,7 +6992,7 @@ def prelu(x, mode, param_attr=None, name=None):
.. code-block:: python .. code-block:: python
x = fluid.layers.data(name="x", shape=[10,10], dtype="float32") x = fluid.layers.data(name="x", shape=[10,10], dtype="float32")
mode = 'channel' mode = 'channel'
output = fluid.layers.prelu(x,mode) output = fluid.layers.prelu(x,mode)
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册