Skip to content

Commit 9447852

Browse files
authored
Update buildmodel_tutorial.py
1 parent 0acb81f commit 9447852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/quickstart/buildmodel_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def forward(self, x):
8080
# Calling the model on the input returns a 10-dimensional tensor with raw predicted values for each class.
8181
# We get the prediction probabilities by passing it through an instance of the ``nn.Softmax`` module.
8282

83-
X = torch.rand(1, 28, 28)
83+
X = torch.rand(1, 28, 28, device=device)
8484
logits = model(X)
8585
pred_probab = nn.Softmax(dim=1)(logits)
8686
y_pred = pred_probab.argmax(1)

0 commit comments

Comments
 (0)