Skip to content

Commit 24a30f8

Browse files
committed
update: test_rho
1 parent 1a0786b commit 24a30f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_optimizer_parameters.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from pytorch_optimizer import load_optimizers
5+
from pytorch_optimizer import SAM, load_optimizers
66

77
OPTIMIZER_NAMES: List[str] = [
88
'adamp',
@@ -65,3 +65,8 @@ def test_betas(optimizer_names):
6565
with pytest.raises(ValueError):
6666
optimizer = load_optimizers(optimizer_names)
6767
optimizer(None, betas=(0.1, -0.1))
68+
69+
70+
def test_rho():
71+
with pytest.raises(ValueError):
72+
SAM(None, load_optimizers('adamp'), rho=-0.1)

0 commit comments

Comments
 (0)