Skip to content

Commit

Permalink
Update benchmark_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandut authored Jul 17, 2023
1 parent b7d2512 commit 6d403af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flamby/benchmarks/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ def train_single_centric(

grad_norm = 0
for param in model.parameters():
grad_norm += torch.linalg.norm(param.grad)
if param.grad is not None:
grad_norm += torch.linalg.norm(param.grad)
grad_norm_history.append(grad_norm)

return model
Expand Down

0 comments on commit 6d403af

Please sign in to comment.