Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed Aug 20, 2022
1 parent d4ede45 commit 50617fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion makemore.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,12 @@ def next(self):
# feed into the model
logits, loss = model(X, Y)

# calculate the gradient, clip it, update the weights
# calculate the gradient, update the weights
model.zero_grad(set_to_none=True)
loss.backward()
optimizer.step()

# wait for all CUDA work on the GPU to finish then calculate iteration time taken
if args.device.startswith('cuda'):
torch.cuda.synchronize()
t1 = time.time()
Expand Down

0 comments on commit 50617fa

Please sign in to comment.