Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefetch_factor #4895

Merged
merged 3 commits into from
Jun 2, 2022
Merged

Add prefetch_factor #4895

merged 3 commits into from
Jun 2, 2022

Conversation

Jackwaterveg
Copy link
Contributor

在 Dataloader 的 API 中增加了 prefetch_factor 这个变量。

@paddle-bot-old
Copy link

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-4895.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

- **collate_fn** (callable, optional) - 通过此参数指定如果将样本列表组合为mini-batch数据,当 ``collate_fn`` 为None时,默认为将样本个字段在第0维上堆叠(同 ``np.stack(..., axis=0)`` )为mini-batch的数据。默认值为None。
- **num_workers** (int, optional) - 用于加载数据的子进程个数,若为0即为不开启子进程,在主进程中进行数据加载。默认值为0。
- **use_buffer_reader** (bool, optional) - 是否使用缓存读取器 。若 ``use_buffer_reader`` 为True,DataLoader会异步地预读取一定数量(默认读取下一个)的 mini-batch 的数据,可加速数据读取过程,但同时会占用少量的CPU/GPU存储,即一个batch输入数据的存储空间。默认值为True。
- **prefetch_factor** (int, optional) - 缓存的mini-batch的个数。若 ``use_buffer_reader`` 为True,DataLoader会异步地预读取 ``prefetch_factor`` 个mini-batch。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是:- **prefetch_factor** (int,可选)

  • 注意标点符号使用中文
  • 注意optional需要翻译为可选

另外,如果该参数有默认值的话需要在参数描述中说明

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ligoml Ligoml merged commit 03951dc into PaddlePaddle:develop Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants