Skip to content

Commit 06c0bcd

Browse files
committed
_optimizer_to_ now correctly send to the input device
1 parent b60c5d1 commit 06c0bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tibert/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _optimizer_to_(
7575
for state in optimizer.state.values():
7676
for k, v in state.items():
7777
if isinstance(v, torch.Tensor):
78-
state[k] = v.cuda()
78+
state[k] = v.to(device)
7979
return optimizer
8080

8181

0 commit comments

Comments
 (0)