From f679692456892695b50283529265e77a8a12b181 Mon Sep 17 00:00:00 2001 From: GaoWei8 <53294385+GaoWei8@users.noreply.github.com> Date: Fri, 27 Sep 2019 16:37:28 +0800 Subject: [PATCH] Fix exp op doc (#1226) * Fix exp op doc test=document_preview * fix exp doc test=document_preview * fix exp doc test=document_preview * fix exp doc test=document_preview * fix exp doc test=document_preview --- doc/fluid/api_cn/layers_cn/exp_cn.rst | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/doc/fluid/api_cn/layers_cn/exp_cn.rst b/doc/fluid/api_cn/layers_cn/exp_cn.rst index d8416b5df..4959d916b 100644 --- a/doc/fluid/api_cn/layers_cn/exp_cn.rst +++ b/doc/fluid/api_cn/layers_cn/exp_cn.rst @@ -5,32 +5,30 @@ exp .. py:function:: paddle.fluid.layers.exp(x, name=None) -Exp激活函数(Exp指以自然常数e为底的指数运算)。 +对输入,逐元素进行以自然数e为底指数运算。 .. math:: out = e^x 参数: + - **x** (Variable) - 该OP的输入为多维Tensor。数据类型为float32,float64。 + - **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为None。 - - **x** - Exp算子的输入 - - **use_cudnn** (BOOLEAN) – (bool,默认为false)是否仅用于cudnn核,需要安装cudnn +返回:输出为Tensor,与 ``x`` 维度相同、数据类型相同。 - -返回: Exp算子的输出 +返回类型: Variable **代码示例**: .. code-block:: python - import paddle.fluid as fluid - data = fluid.layers.data(name="input", shape=[32, 784]) - result = fluid.layers.exp(data) - - - - - - - - + import paddle.fluid as fluid + import numpy as np + input_exp = np.array([[-1.5,6],[1,15.6]]) + with fluid.dygraph.guard(): + x = fluid.dygraph.to_variable(input_exp) + y = fluid.layers.exp(x) + print(y.numpy()) + # [[2.23130160e-01 4.03428793e+02] + # [2.71828183e+00 5.95653801e+06]] -- GitLab