Skip to content

Commit 60ad96b

Browse files
committed
Fixed linting issue
1 parent 85814b4 commit 60ad96b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import typing
2+
13
import pytest
24
import torch
35

@@ -31,7 +33,7 @@ def unwrap_schedule(scheduler: torch.optim.lr_scheduler.LambdaLR,
3133
for _ in range(num_steps):
3234
lrs.append(scheduler.get_lr()[0])
3335
scheduler.step()
34-
return lrs
36+
return typing.cast(list[float], lrs)
3537
test_model = torch.nn.Linear(50, 50)
3638
test_optimizer = torch.optim.AdamW(test_model.parameters(), lr=10.0)
3739
test_scheduler = utils.get_linear_schedule_with_warmup(test_optimizer, 2, 10)

0 commit comments

Comments
 (0)