Skip to content

Commit 0338569

Browse files
committed
update: test_lomo_optimizer
1 parent 9e7536e commit 0338569

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/test_optimizers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ def test_lomo_optimizer(precision, environment):
469469

470470
if precision == 16:
471471
model.fc1.weight.data = torch.randn(2, 2, dtype=torch.float16)
472+
model.fc1.weight.grad = torch.zeros(2, 2, dtype=torch.float16)
472473

473474
optimizer = load_optimizer('lomo')(model, clip_grad_norm=1.0, clip_grad_value=1.0)
474475

0 commit comments

Comments
 (0)