Clarify model output dimensions in buildmodel tutorial - #3968
MichelleHan7 wants to merge 1 commit into
Conversation
The sentence describing the output of model(X) read as if dim=0 held the 10 class scores, and it never mentioned the batch dimension. State the output shape (batch_size, 10) and what each dimension holds. Fixes pytorch#3622 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3968
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @MichelleHan7! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Fixes #3622
Description
In the "Build the Neural Network" tutorial, the sentence describing the output of
model(X)says dim=0 corresponds to "each output of 10 raw predicted values for each class" and dim=1 to "the individual values of each output." It reads as if dim=0 held the 10 class scores, and it never mentions the batch dimension.This PR rewrites that sentence to give the output shape,
(batch_size, 10): dim=0 corresponds to each sample in the batch, and dim=1 to the logits for each of the 10 classes. That matches the code right after it, which appliesnn.Softmax(dim=1)andargmax(1)over the class dimension, and the "minibatch dimension (at dim=0)" wording later in the same tutorial. Only the comment changes; the code is untouched.This picks up #3623 by @vaharoni, which was approved but closed by the stale bot before it was merged.
Checklist
bug; I can't add labels as an outside contributor)🤖 Generated with Claude Code