pytorch / pytorch/tutorials

Feedback about Quickstart

Open
#3,610 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core
Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Page: https://docs.pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html

The example training loop under the Optimizing the Model Parameters section is not using the standard order of zero_grad(), backward(), step().

As written currently in the documentation:

# Backpropagation
loss.backward()
optimizer.step()
optimizer.zero_grad()

The same issue exists in the Optimizing Model Parameters: page: https://docs.pytorch.org/tutorials/beginner/basics/optimization_tutorial.html

cc @albanD @jbschlosser

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the Quickstart Tutorial and Optimizing Model Parameters pages, then locate the training loop under the Optimizing the Model Parameters section. Compare the documented calls with the standard zero_grad(), backward(), step() order, update both examples, and verify that the two pages show the corrected sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.