Skip to content

Commit 129e318

Browse files
davychxnsvekars
andauthored
Fix 2 incorrect argument positioning in Tutorial (#3042)
1. "weights_only" is augument of torch.load, not for model.load_state_dict Here is the doc: https://pytorch.org/docs/stable/generated/torch.load.html Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent 7377530 commit 129e318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/saving_loading_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
# .. code:: python
408408
#
409409
# modelB = TheModelBClass(*args, **kwargs)
410-
# modelB.load_state_dict(torch.load(PATH), strict=False, weights_only=True)
410+
# modelB.load_state_dict(torch.load(PATH, weights_only=True), strict=False)
411411
#
412412
# Partially loading a model or loading a partial model are common
413413
# scenarios when transfer learning or training a new complex model.

0 commit comments

Comments
 (0)