Fix test_serialization_zipfile_actually_jit when weights_only is not default (#143668)

Fails in fbcode where weights_only isn't default

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143668
Approved by: https://github.com/awgu
ghstack dependencies: #143326, #143403
This commit is contained in:
Mikayla Gawarecki
2024-12-20 10:44:42 -08:00
committed by PyTorch MergeBot
parent 33dd4f187d
commit 372b023eb1

View File

@ -1020,7 +1020,7 @@ class TestSerialization(TestCase, SerializationMixin):
RuntimeError,
re.escape("Cannot use ``weights_only=True`` with TorchScript archives passed to ``torch.load``")
):
torch.load(f)
torch.load(f, weights_only=True)
f.seek(0)
torch.load(f, weights_only=False)