Skip to content

Commit 82e0ee2

Browse files
committed
update docs
1 parent da15f1f commit 82e0ee2

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

docs/api/paddle/amp/decorate_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ decorate
2121
- **save_dtype** (str|None, 可选) - 网络存储类型,可为float16、float32、float64。通过 ``save_dtype`` 可指定通过 ``paddle.save`` 和 ``paddle.jit.save`` 存储的网络参数数据类型。默认为None,采用现有网络参数类型进行存储。
2222

2323

24-
代码示例
24+
代码示例
2525
:::::::::
2626
COPY-FROM: paddle.amp.decorate

docs/api/paddle/io/DataLoader_cn.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ from_generator(feed_list=None, capacity=None, use_double_buffer=True, iterable=T
143143
- **drop_last** (bool): 是否丢弃最后的不足CPU/GPU设备数的批次。默认值为True。在网络训练时,用户不能设置drop_last=False,此时所有CPU/GPU设备均应从DataLoader中读取到数据。在网络预测时,用户可以设置drop_last=False,此时最后不足CPU/GPU设备数的批次可以进行预测。
144144

145145
**返回**
146-
被创建的DataLoader对象
147146

148-
**返回类型**
149-
loader (DataLoader)
147+
被创建的DataLoader对象。
148+
150149

151150
**代码示例 1**
152151

@@ -349,8 +348,7 @@ from_generator(feed_list=None, capacity=None, use_double_buffer=True, iterable=T
349348
print("Epoch {} batch {}: loss = {}".format(
350349
epoch_id, batch_id, np.mean(loss.numpy())))
351350
352-
代码示例 3
353-
::::::::::::
351+
**代码示例 3**
354352

355353
.. code-block:: python
356354
@@ -415,10 +413,9 @@ from_dataset(dataset, places, drop_last=True)
415413
- **drop_last** (bool) - 是否丢弃最后样本数量不足batch size的batch。若drop_last = True则丢弃,若drop_last = False则不丢弃。
416414

417415
**返回**
418-
被创建的DataLoader对象,可以for-range的方式循环迭代
419416

420-
**返回类型**
421-
loader (DataLoader)
417+
被创建的DataLoader对象,可以for-range的方式循环迭代。
418+
422419

423420
**代码示例**
424421

docs/api/paddle/io/DistributedBatchSampler_cn.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ DistributedBatchSampler,返回样本下标数组的迭代器。
5656
# do something
5757
break
5858
59-
.. py:function:: set_epoch(epoch)
59+
方法
60+
::::::::::::
61+
set_epoch(epoch)
62+
'''''''''
6063

6164
设置epoch数。当设置``shuffle=True``时,此epoch被用作随机种子。默认情况下,用户可以不用此接口设置,每个epoch时,所有的进程(workers)使用不同的顺序。如果每个epoch设置相同的数字,每个epoch数据的读取顺序将会相同。
6265

63-
参数
64-
::::::::::::
66+
**参数**
6567

6668
- **epoch** (int) - epoch数。
6769

68-
代码示例
69-
::::::::::::
70+
**代码示例**
7071

7172
.. code-block:: python
7273

docs/api/paddle/io/IterableDataset_cn.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IterableDataset
1616

1717
见 ``paddle.io.DataLoader`` 。
1818

19-
代码示例
19+
代码示例 1
2020
::::::::::::
2121

2222
.. code-block:: python
@@ -42,11 +42,12 @@ IterableDataset
4242
当 ``paddle.io.DataLoader`` 中 ``num_workers > 0`` 时,每个子进程都会遍历全量的数据集返回全量样本,所以数据集会重复 ``num_workers``
4343
次,如果需要数据集样本不会重复返回,可通过如下两种方法避免样本重复,两种方法中都需要通过 ``paddle.io.get_worker_info`` 获取各子进程的信息。
4444

45-
1. 通过 ``__iter__`` 函数划分各子进程的数据
4645

47-
代码示例 1
46+
代码示例 2
4847
::::::::::::
4948

49+
通过 ``__iter__`` 函数划分各子进程的数据
50+
5051
.. code-block:: python
5152
5253
import math
@@ -86,11 +87,12 @@ IterableDataset
8687
print(data)
8788
# outputs: [2, 5, 3, 6, 4, 7]
8889
89-
2. 通过各子进程初始化函数 ``worker_inif_fn`` 划分子进程数据
9090
91-
代码示例 2
91+
代码示例 3
9292
::::::::::::
9393

94+
通过各子进程初始化函数 ``worker_inif_fn`` 划分子进程数据
95+
9496
.. code-block:: python
9597
9698
import math

0 commit comments

Comments
 (0)