Skip to content

Commit

Permalink
[AIR] Label Checkpoint.from_checkpoint as developer API (#33094)
Browse files Browse the repository at this point in the history
See discussion on #29058.

---------

Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
  • Loading branch information
bveeramani authored Mar 7, 2023
1 parent 57a909d commit 09a53b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/ray/air/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,15 @@ def from_directory(cls, path: Union[str, os.PathLike]) -> "Checkpoint":

return checkpoint

# TODO: Deprecate `from_checkpoint`. For context, see #29058.
@classmethod
@DeveloperAPI
def from_checkpoint(cls, other: "Checkpoint") -> "Checkpoint":
"""Create a checkpoint from a generic :py:class:`Checkpoint`.
"""Create a checkpoint from a generic :class:`Checkpoint`.
This method can be used to create a framework-specific checkpoint from a
generic :py:class:`Checkpoint` object.
generic :class:`Checkpoint` object.
Examples:
>>> result = TorchTrainer.fit(...) # doctest: +SKIP
>>> checkpoint = TorchCheckpoint.from_checkpoint(result.checkpoint) # doctest: +SKIP # noqa: E501
>>> model = checkpoint.get_model() # doctest: +SKIP
Expand Down

0 comments on commit 09a53b5

Please sign in to comment.