Skip to content

Commit

Permalink
fix restore_checkpoint example in docstring
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 655125502
  • Loading branch information
Cristian Garcia authored and Flax Authors committed Jul 23, 2024
1 parent d718655 commit 46dc51e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flax/training/checkpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def restore_checkpoint(
>>> from flax.training import checkpoints
>>> import jax.numpy as jnp
>>> import tempfile
...
>>> with tempfile.TemporaryDirectory() as dir_path:
... test_object = {
... 'a': jnp.array([1, 2, 3], jnp.int32),
Expand Down Expand Up @@ -1063,9 +1063,11 @@ def restore_checkpoint(
``orbax_checkpointer.restore()`` call.
Returns:
Restored ``target`` updated from checkpoint file, or if no step specified and
Restored ``target`` updated from checkpoint file, or if no step specified
and
no checkpoint files present, returns the passed-in ``target`` unchanged.
If a file path is specified and is not found, the passed-in ``target`` will be
If a file path is specified and is not found, the passed-in ``target`` will
be
returned. This is to match the behavior of the case where a directory path
is specified but the directory has not yet been created.
"""
Expand Down

0 comments on commit 46dc51e

Please sign in to comment.