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 save_state_dict and load_state_dict ch doc #6355

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/api/paddle/distributed/load_state_dict_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _cn_api_paddle_distributed_load_state_dict:

load_state_dict
-------------------------------


.. py:function:: paddle.distributed.load_state_dict(state_dict, path, process_group=None, coordinator_rank=0)

用于自动并行场景下,从指定路径加载参数。

参数
:::::::::
- **state_dict** (dict) - 待加载的参数。
- **path** (str) - 加载参数的路径。
- **process_group** (Group,可选) - 执行该操作的进程组实例(通过 ``new_group`` 创建)。默认为 None,即使用全局默认进程组。
- **coordinator_rank** (int,可选) - 指定协调者的 rank。默认为 0。

返回
:::::::::
无返回值。

代码示例
:::::::::
COPY-FROM: paddle.distributed.load_state_dict
24 changes: 24 additions & 0 deletions docs/api/paddle/distributed/save_state_dict_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _cn_api_paddle_distributed_save_state_dict:

save_state_dict
-------------------------------


.. py:function:: paddle.distributed.save_state_dict(state_dict, path, process_group=None, coordinator_rank=0)

用于自动并行场景下,将参数保存到指定路径。

参数
:::::::::
- **state_dict** (dict) - 待保存的参数。
- **path** (str) - 保存参数的路径。
- **process_group** (Group,可选) - 执行该操作的进程组实例(通过 ``new_group`` 创建)。默认为 None,即使用全局默认进程组。
- **coordinator_rank** (int,可选) - 指定协调者的 rank。默认为 0。

返回
:::::::::
无返回值。

代码示例
:::::::::
COPY-FROM: paddle.distributed.save_state_dict