Skip to content

Commit

Permalink
[docs] update code in tracking documentation (#3235)
Browse files Browse the repository at this point in the history
* update example code

* revert
  • Loading branch information
faaany authored Nov 20, 2024
1 parent e724c9a commit 8ad2b3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/usage_guides/tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ config = {

accelerator.init_trackers("example_project", config=config)

my_model, my_optimizer, my_training_dataloader = accelerate.prepare(my_model, my_optimizer, my_training_dataloader)
my_model, my_optimizer, my_training_dataloader = accelerator.prepare(my_model, my_optimizer, my_training_dataloader)
device = accelerator.device
my_model.to(device)

for iteration in config["num_iterations"]:
for step, batch in my_training_dataloader:
for step, batch in enumerate(my_training_dataloader):
my_optimizer.zero_grad()
inputs, targets = batch
inputs = inputs.to(device)
Expand Down

0 comments on commit 8ad2b3b

Please sign in to comment.