File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/lightning/fabric/utilities Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ def _load(
41
41
Args:
42
42
path_or_url: Path or URL of the checkpoint.
43
43
map_location: a function, ``torch.device``, string or a dict specifying how to remap storage locations.
44
+ weights_only: If ``True``, restricts loading to ``state_dicts`` of plain ``torch.Tensor`` and other primitive
45
+ types. If loading a checkpoint from a trusted source that contains an ``nn.Module``, use
46
+ ``weights_only=False``. If loading checkpoint from an untrusted source, we recommend using
47
+ ``weights_only=True``. For more information, please refer to the
48
+ `PyTorch Developer Notes on Serialization Semantics <https://docs.pytorch.org/docs/main/notes/serialization.html#id3>`__.
44
49
45
50
"""
46
51
if not isinstance (path_or_url , (str , Path )):
You can’t perform that action at this time.
0 commit comments