Skip to content

Commit 70f492c

Browse files
committed
cleanup
1 parent 6ce7576 commit 70f492c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lion_pytorch/foreach.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
):
2323
assert lr > 0.
2424
assert all([0. <= beta <= 1. for beta in betas])
25-
assert all([hasattr(torch, attr) for attr in ('_foreach_mul_', '_foreach_add_', '_foreach_sign_', '_foreach_lerp_')]), 'this version of torch does not have the prerequisite foreach functions'
25+
assert all([hasattr(torch, f'_foreach_{attr}_') for attr in ('mul', 'add', 'sign', 'lerp')]), 'this version of torch does not have the prerequisite foreach functions'
2626

2727
self._init_lr = lr
2828
self.decoupled_wd = decoupled_weight_decay

0 commit comments

Comments
 (0)