Skip to content

Commit

Permalink
fix reciprocal doc spec (PaddlePaddle#1224)
Browse files Browse the repository at this point in the history
* fix reciprocal doc spec test=develop

* fix doc test=develop

* fix according reviewer advice test=develop

* fix according the review advice test=develop

* fix according the review advice test=develop
  • Loading branch information
wangchaochaohu committed Sep 25, 2019
1 parent ff8ecb0 commit d48a20e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/fluid/api_cn/layers_cn/reciprocal_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@ reciprocal

.. py:function:: paddle.fluid.layers.reciprocal(x, name=None)
Reciprocal(取倒数)激活函数
reciprocal 对输入Tensor取倒数


.. math::
out = \frac{1}{x}
参数:

- **x** - reciprocal算子的输入
- **use_cudnn** (BOOLEAN) – (bool,默认为false)是否仅用于cudnn核,需要安装cudnn
- **x** - 输入的多维Tensor,支持的数据类型为float32,float64。
- **name** (str,可选) – 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,默认值为None。

返回: Reciprocal算子的输出。

返回: 对输入取倒数得到的Tensor,输出Tensor数据类型和维度与输入相同。

**代码示例**:

.. code-block:: python
import paddle.fluid as fluid
data = fluid.layers.data(name="input", shape=[32, 784])
result = fluid.layers.reciprocal(data)
data = fluid.layers.fill_constant(shape=[2], value=4, dtype='float32') #data=[4.0, 4.0]
result = fluid.layers.reciprocal(data) # result=[0.25, 0.25]
Expand Down

0 comments on commit d48a20e

Please sign in to comment.