diff --git a/python/paddle/distributed/checkpoint/__init__.py b/python/paddle/distributed/checkpoint/__init__.py index da89b737adfb8d..595add0aed9e11 100644 --- a/python/paddle/distributed/checkpoint/__init__.py +++ b/python/paddle/distributed/checkpoint/__init__.py @@ -11,11 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from .save_state_dict import save_state_dict -from .load_state_dict import load_state_dict - -__all__ = [ - "save_state_dict", - "load_state_dict", -] diff --git a/python/paddle/distributed/checkpoint/load_state_dict.py b/python/paddle/distributed/checkpoint/load_state_dict.py index fd618236a58ae2..9611fc8c0c726d 100644 --- a/python/paddle/distributed/checkpoint/load_state_dict.py +++ b/python/paddle/distributed/checkpoint/load_state_dict.py @@ -360,14 +360,17 @@ def load_state_dict( ) -> None: """ Load the state_dict inplace from a checkpoint path. + Args: state_dict(Dict[str, paddle.Tensor]): The state_dict to load. It will be modified inplace after loading. path(str): The directory to load checkpoint files. process_group(paddle.distributed.collective.Group): ProcessGroup to be used for cross-rank synchronization. Use the default process group which contains all cards. coordinator_rank(int): The rank used to coordinate the checkpoint. Rank0 is used by default. + Example: .. code-block:: python - >>> # doctest: +SKIP('Load state dict.') + + >>> # doctest: +SKIP('run in distributed mode.') >>> import paddle >>> import paddle.distributed as dist >>> ckpt_path = "./checkpoint" diff --git a/python/paddle/distributed/checkpoint/save_state_dict.py b/python/paddle/distributed/checkpoint/save_state_dict.py index 4b7f3665d86da2..4e595d22d20b6a 100644 --- a/python/paddle/distributed/checkpoint/save_state_dict.py +++ b/python/paddle/distributed/checkpoint/save_state_dict.py @@ -88,7 +88,8 @@ def save_state_dict( Examples: .. code-block:: python - >>> # doctest: +SKIP('Save state dict.') + + >>> # doctest: +SKIP('run in distributed mode') >>> import paddle >>> import paddle.distributed as dist >>> w1 = paddle.arange(32).reshape([4, 8])