Skip to content

Commit

Permalink
1000th update
Browse files Browse the repository at this point in the history
  • Loading branch information
inikishev authored Dec 25, 2024
1 parent f8816a2 commit 382d9d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def closure(backward = True):
preds = model(inputs)
loss = loss_fn(preds, targets)

# if you can't call loss.backward() and use gradient-free methods, they always call closure with backward=False.
# if you can't call loss.backward(), and instead use gradient-free methods,
# they always call closure with backward=False.
# so you can remove the part below, but keep the unused backward argument.
if backward:
optimizer.zero_grad()
Expand Down

0 comments on commit 382d9d0

Please sign in to comment.