Skip to content

Commit 651e901

Browse files
committed
add code to forward prop before loss calculation
1 parent a500ce7 commit 651e901

File tree

1 file changed

+1
-0
lines changed
  • tutorials/00 - PyTorch Basics

1 file changed

+1
-0
lines changed

tutorials/00 - PyTorch Basics/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
# linear.bias.data.sub_(0.01 * linear.bias.grad.data)
7373

7474
# Print out the loss after optimization.
75+
pred = linear(x)
7576
loss = criterion(pred, y)
7677
print('loss after 1 step optimization: ', loss.data[0])
7778

0 commit comments

Comments
 (0)