Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanNaren committed Aug 13, 2021
1 parent 9cfe98f commit 8f234e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/source/advanced/checkpoint_io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ that is managed by the ``TrainingTypePlugin``.
from pytorch_lightning.plugins import CheckpointIO, SingleDevicePlugin
class CustomCheckpointPlugin(CheckpointIO):
class CustomCheckpointIO(CheckpointIO):
def save_checkpoint(
self, checkpoint: Dict[str, Any], path: Union[str, Path], storage_options: Optional[Any] = None
) -> None:
Expand All @@ -28,12 +28,12 @@ that is managed by the ``TrainingTypePlugin``.
...
checkpoint_plugin = CustomCheckpointPlugin()
custom_checkpoint_io = CustomCheckpointIO()
# Pass into the Trainer object
model = MyModel()
trainer = Trainer(
plugins=[checkpoint_plugin],
plugins=[custom_checkpoint_io],
callbacks=ModelCheckpoint(save_last=True),
)
trainer.fit(model)
Expand All @@ -42,7 +42,7 @@ that is managed by the ``TrainingTypePlugin``.
model = MyModel()
device = torch.device("cpu")
trainer = Trainer(
plugins=SingleDevicePlugin(device, checkpoint_io=checkpoint_plugin),
plugins=SingleDevicePlugin(device, checkpoint_io=custom_checkpoint_io),
callbacks=ModelCheckpoint(save_last=True),
)
trainer.fit(model)
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/plugins/io/torch_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def load_checkpoint(
self, path: _PATH, map_location: Optional[Callable] = lambda storage, loc: storage
) -> Dict[str, Any]:
"""
Loads checkpoint using torch.load, with additional handling for fsspec remote loading of files.
Loads checkpoint using :func:`torch.load`, with additional handling for ``fsspec`` remote loading of files.
Args:
path: Path to checkpoint
Expand Down

0 comments on commit 8f234e0

Please sign in to comment.