We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2977890 + 129e318 commit 3e6c1d8Copy full SHA for 3e6c1d8
beginner_source/saving_loading_models.py
@@ -153,7 +153,7 @@
153
# .. code:: python
154
#
155
# model = TheModelClass(*args, **kwargs)
156
-# model.load_state_dict(torch.load(PATH), weights_only=True)
+# model.load_state_dict(torch.load(PATH, weights_only=True))
157
# model.eval()
158
159
# .. note::
@@ -407,7 +407,7 @@
407
408
409
# modelB = TheModelBClass(*args, **kwargs)
410
-# modelB.load_state_dict(torch.load(PATH), strict=False, weights_only=True)
+# modelB.load_state_dict(torch.load(PATH, weights_only=True), strict=False)
411
412
# Partially loading a model or loading a partial model are common
413
# scenarios when transfer learning or training a new complex model.
0 commit comments