Skip to content

Update autogradyt_tutorial.py #2247

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

Merged
merged 1 commit into from
Mar 15, 2023
Merged

Update autogradyt_tutorial.py #2247

merged 1 commit into from
Mar 15, 2023

Conversation

svekars
Copy link
Contributor

@svekars svekars commented Mar 13, 2023

Fix #2219
According to the doc, the default value of optimizer.zero_grad has changed from True to False which results in the tutorial failing against the 2.0 binaries unless explicitly specified. To fix this in the autograd tutorial, adding the following:

Optimizer.zero_grad(set_to_none=True)

@netlify
Copy link

netlify bot commented Mar 13, 2023

Deploy Preview for pytorch-tutorials-preview ready!

Name Link
🔨 Latest commit 9850cd1
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-tutorials-preview/deploys/640f47eee009fe0008645c35
😎 Deploy Preview https://deploy-preview-2247--pytorch-tutorials-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@svekars svekars merged commit f6e074a into main Mar 15, 2023
@svekars svekars deleted the fix-autograd-2.0 branch March 15, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update autogradyt_tutorial.py for 2.0
2 participants