Skip to content

Commit fc6089b

Browse files
committed
Properly initialize initial_loss variable in polynomial_autograd.py
1 parent 615085c commit fc6089b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

beginner_source/examples_autograd/polynomial_autograd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
c = torch.randn((), dtype=dtype, requires_grad=True)
4040
d = torch.randn((), dtype=dtype, requires_grad=True)
4141

42+
initial_loss = 1.
4243
learning_rate = 1e-5
4344
for t in range(5000):
4445
# Forward pass: compute predicted y using operations on Tensors.

0 commit comments

Comments
 (0)