Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tocean committed Jan 9, 2024
1 parent 4415d82 commit e2d2f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion examples/mnist_ddp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""The ddp mnist example using MS-AMP. It is adapted from https://github.com/pytorch/examples/blob/main/mnist/main.py."""
"""The ddp mnist example using MS-AMP.
It is adapted from https://github.com/pytorch/examples/blob/main/mnist/main.py.
"""

from __future__ import print_function
import os
Expand Down
4 changes: 2 additions & 2 deletions examples/mnist_fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def train(args, model, rank, world_size, train_loader, optimizer, epoch, sampler
sampler.set_epoch(epoch)
for batch_idx, (data, target) in enumerate(train_loader):
data, target = data.to(rank), target.to(rank)

optimizer.zero_grad()

output = model(data)
loss = F.nll_loss(output, target, reduction='sum')
loss.backward()
Expand Down

0 comments on commit e2d2f03

Please sign in to comment.