Skip to content

Commit 3e6c1d8

Browse files
authored
Merge branch 'main' into add-sitemap
2 parents 2977890 + 129e318 commit 3e6c1d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

beginner_source/saving_loading_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
# .. code:: python
154154
#
155155
# model = TheModelClass(*args, **kwargs)
156-
# model.load_state_dict(torch.load(PATH), weights_only=True)
156+
# model.load_state_dict(torch.load(PATH, weights_only=True))
157157
# model.eval()
158158
#
159159
# .. note::
@@ -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)