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.
1 parent d40dc05 commit 4e97bceCopy full SHA for 4e97bce
beginner_source/saving_loading_models.py
@@ -156,6 +156,12 @@
156
# model.load_state_dict(torch.load(PATH))
157
# model.eval()
158
#
159
+# .. note::
160
+# The 1.6 release of PyTorch switched ``torch.save`` to use a new
161
+# zipfile-based file format. ``torch.load`` still retains the ability to
162
+# load files in the old format. If for any reason you want ``torch.save``
163
+# to use the old format, pass the kwarg ``_use_new_zipfile_serialization=False``.
164
+#
165
# When saving a model for inference, it is only necessary to save the
166
# trained model’s learned parameters. Saving the model’s *state_dict* with
167
# the ``torch.save()`` function will give you the most flexibility for
0 commit comments