tutorials
tutorials copied to clipboard
Fix backpropagation order in optimization tutorial
Reorder optimizer.zero_grad(), loss.backward(), and optimizer.step() to match the recommended best practice documented in the tutorial.
Fixes #3507
Description
Checklist
- [ ] The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
- [ ] Only one issue is addressed in this pull request
- [ ] Labels from the issue that this PR is fixing are added to this pull request
- [ ] No unnecessary issues are included into this pull request.