-
Notifications
You must be signed in to change notification settings - Fork 22.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added 'weights_only' param in torch.load examples #112860
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/112860
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 809c2f4 with merge base b10fa8a (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "docathon-h2-2023" |
Also, very recently on a nightly Maybe would be nice to assert in test that it produces no warnings |
Do you mean to add context manager, |
I think, this UserWarning needs to be fixed by not using the deprecated UntypedStorage... It's just strange that hopefully-soon-to-be-default-safe-method raises deprecation warnings :) which sort of deceiptfully signals that the user's not doing the right thing by using |
Deprecation UserWarning was on |
That depreciation warning is also coming in 2.1.0 stable with cuda 11.8 |
"All storage classes except for torch.UntypedStorage will be removed in the future, and torch.UntypedStorage will be used in all cases." |
@kit1980 a gentle reminder to review the PR. |
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes pytorch#111876 `torch.load` without setting `weights_only=True` is unsafe. So updating examples of `torch.load` to use `weights_only=True` where possible and `weights_only=False` elsewhere with a warning of being unsafety. Pull Request resolved: pytorch#112860 Approved by: https://github.com/kit1980
Fixes pytorch#111876 `torch.load` without setting `weights_only=True` is unsafe. So updating examples of `torch.load` to use `weights_only=True` where possible and `weights_only=False` elsewhere with a warning of being unsafety. Pull Request resolved: pytorch#112860 Approved by: https://github.com/kit1980
Fixes #111876
torch.load
without settingweights_only=True
is unsafe. So updating examples oftorch.load
to useweights_only=True
where possible andweights_only=False
elsewhere with a warning of being unsafety.cc @svekars @carljparker