Skip to content

Commit

Permalink
update guides (#3511)
Browse files Browse the repository at this point in the history
* update guides

* update api

* update api
  • Loading branch information
TCChenlong authored May 19, 2021
1 parent b9c2194 commit 4ca7944
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 532 deletions.
12 changes: 6 additions & 6 deletions docs/api/paddle/assign_cn.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.. _cn_api_fluid_layers_assign:
.. _cn_api_paddle_tensor_creation_assign:

assign
-------------------------------

.. py:function:: paddle.assign(input,output=None)
.. py:function:: paddle.assign(x,output=None)
该OP将输入Tensor或numpy数组拷贝至输出Tensor。

参数:
- **input** (Tensor|np.ndarray) - 输入Tensor,或numpy数组,或由基本数据组成的list/tuple,或基本数据,支持数据类型为float32, float64, int32, int64和bool。注意:由于当前框架的protobuf传输数据限制,float64数据会被转化为float32数据。
- **x** (Tensor|np.ndarray|list|tuple|scalar) - 输入Tensor,或numpy数组,或由基本数据组成的list/tuple,或基本数据,支持数据类型为float32, float64, int32, int64和bool。注意:由于当前框架的protobuf传输数据限制,float64数据会被转化为float32数据。
- **output** (Tensor,可选) - 输出Tensor。如果为None,则创建一个新的Tensor作为输出Tensor,默认值为None。

返回:输出Tensor,形状、数据类型、数据值和 ``input`` 一致。
返回:输出Tensor,形状、数据类型、数据值和 ``x`` 一致。


**代码示例**:
Expand All @@ -25,8 +25,8 @@ assign
import numpy as np
data = paddle.full(shape=[3, 2], fill_value=2.5, dtype='float64') # [[2.5, 2.5], [2.5, 2.5], [2.5, 2.5]]
array = np.array([[1, 1],
[3, 4],
[1, 3]]).astype(np.int64)
[3, 4],
[1, 3]]).astype(np.int64)
result1 = paddle.zeros(shape=[3, 3], dtype='float32')
paddle.assign(array, result1) # result1 = [[1, 1], [3 4], [1, 3]]
result2 = paddle.assign(data) # result2 = [[2.5, 2.5], [2.5, 2.5], [2.5, 2.5]]
Expand Down
21 changes: 12 additions & 9 deletions docs/api/paddle/increment_cn.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
.. _cn_api_fluid_layers_increment:
.. _cn_api_tensor_increment:

increment
-------------------------------

.. py:function:: paddle.increment(x, value=1.0, name=None)
使输入Tensor ``x`` 的数据累加 ``value`` , 该OP通常用于循环次数的计数。
参数:
- **x** (Tensor) – 元素个数为1的Tensor,数据类型必须为float32,float64,int32,int64。
- **value** (float,可选) – 需要增加的值,默认为1.0。
- **name** (str,可选) – 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为None。
返回:Tensor,累加结果,形状、数据类型和 ``x`` 一致
该OP在控制流程中用来让 ``x`` 的数值增加 ``value``

**代码示例**
**参数**:
- **x** (Tensor) – 输入张量,必须始终只有一个元素。支持的数据类型:float32,float64,int32,int64。
- **value** (float,可选) – ``x`` 的数值增量。默认值为1.0。
- **name** (str,可选) – 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,默认值为None。

.. code-block:: python
**返回**: Tensor,形状和数据类型同输入 ``x`` 。


**代码示例**:

.. code-block:: python
import paddle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CTCLoss
-------------------------------

.. py:class:: paddle.nn.loss.CTCLoss(blank=0, reduction='mean')
.. py:class:: paddle.nn.CTCLoss(blank=0, reduction='mean')
该接口用于计算 CTC loss。该接口的底层调用了第三方 baidu-research::warp-ctc 的实现。
也可以叫做 softmax with CTC,因为 Warp-CTC 库中插入了 softmax 激活函数来对输入的值进行归一化。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
L1Loss
-------------------------------

.. py:class:: paddle.nn.loss.L1Loss(reduction='mean', name=None)
.. py:class:: paddle.nn.L1Loss(reduction='mean', name=None)
该接口用于创建一个L1Loss的可调用类,L1Loss计算输入input和标签label间的 `L1 loss` 损失。

Expand Down
34 changes: 0 additions & 34 deletions docs/api/paddle/nn/clip_by_norm_cn.rst

This file was deleted.

38 changes: 0 additions & 38 deletions docs/api/paddle/nn/clip_cn.rst

This file was deleted.

83 changes: 0 additions & 83 deletions docs/api/paddle/nn/cond_cn.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
grid_sample
-------------------------------

.. py:function:: paddle.nn.function.grid_sample(x, grid, mode='bilinear', padding_mode='zeros', align_corners=True, name=None):
.. py:function:: paddle.nn.functional.grid_sample(x, grid, mode='bilinear', padding_mode='zeros', align_corners=True, name=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
max_pool3d
-------------------------------

.. py:function:: paddle.nn.functinoal.max_pool3d(x, kernel_size, stride=None, padding=0, ceil_mode=False, return_mask=False, data_format="NCDHW", name=None))
.. py:function:: paddle.nn.functional.max_pool3d(x, kernel_size, stride=None, padding=0, ceil_mode=False, return_mask=False, data_format="NCDHW", name=None))
该函数是一个三维最大池化函数,根据输入参数 `kernel_size`, `stride`,
`padding` 等参数对输入 `x` 做最大池化操作。

Expand Down
105 changes: 0 additions & 105 deletions docs/api/paddle/optimizer/lr_scheduler/LinearLrWarmup_cn.rst

This file was deleted.

Loading

0 comments on commit 4ca7944

Please sign in to comment.