From a3abef7a79d5e51e17f00fbe98995e7ea6587923 Mon Sep 17 00:00:00 2001 From: Michelle Han Date: Fri, 25 Sep 2026 01:13:16 -0400 Subject: [PATCH] Clarify model output dimensions in buildmodel tutorial 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 #3622 Co-Authored-By: Claude Opus 5.5 --- beginner_source/basics/buildmodel_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/basics/buildmodel_tutorial.py b/beginner_source/basics/buildmodel_tutorial.py index 5cbaf60602..dd4f4560a6 100644 --- a/beginner_source/basics/buildmodel_tutorial.py +++ b/beginner_source/basics/buildmodel_tutorial.py @@ -75,7 +75,7 @@ def forward(self, x): # along with some `background operations `_. # Do not call ``model.forward()`` directly! # -# Calling the model on the input returns a 2-dimensional tensor with dim=0 corresponding to each output of 10 raw predicted values for each class, and dim=1 corresponding to the individual values of each output. +# Calling the model on the input returns a 2-dimensional tensor of shape ``(batch_size, 10)``, with dim=0 corresponding to each sample in the batch and dim=1 corresponding to the raw predicted values (logits) for each of the 10 classes. # We get the prediction probabilities by passing it through an instance of the ``nn.Softmax`` module. X = torch.rand(1, 28, 28, device=device)