Skip to content

Commit

Permalink
Set RNG seed for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitSolomonPrinceton committed Sep 16, 2024
1 parent 2234b2b commit 4a17a65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_gen_torch_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

from cvxtorch.torch_expression import TorchExpression

seed = 12345
np.random.seed(seed)
torch.manual_seed(seed)

class TestGenTorchExp(unittest.TestCase):
""" Unit tests for the atoms module. """
Expand Down
3 changes: 3 additions & 0 deletions tests/test_torch_numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from cvxtorch.utils.exp2tch import EXPR2TORCH
from tests.settings import ATOL, RTOL

seed = 12345
np.random.seed(seed)
torch.manual_seed(seed)

class TestTorchNumeric(unittest.TestCase):
""" Unit tests for the atoms torch_numeric. """
Expand Down

0 comments on commit 4a17a65

Please sign in to comment.