Skip to content

Commit

Permalink
Merge 2d72246 into 4871a9a
Browse files Browse the repository at this point in the history
  • Loading branch information
esantorella authored Jul 26, 2023
2 parents 4871a9a + 2d72246 commit 23cdfd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/optim/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_basic(self):
def test_timeout(self):
x = Parameter(torch.tensor(1.0))
# adding a small delay here to combat some timing issues on windows
closure = partial(norm_squared, x, delay=1e-3)
closure = partial(norm_squared, x, delay=1e-2)
result = scipy_minimize(closure, {"x": x}, timeout_sec=1e-4)
self.assertEqual(result.status, OptimizationStatus.STOPPED)
self.assertTrue("Optimization timed out after" in result.message)
Expand Down
2 changes: 1 addition & 1 deletion test/optim/utils/test_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def f_and_g(x: np.ndarray, sleep_sec: float = 0.0):
self.assertEqual(res.nit, 2) # quadratic approx. is exact

with self.subTest("test w/ binding timeout"):
res = minimize_with_timeout(**base_kwargs, args=(1e-3,), timeout_sec=1e-4)
res = minimize_with_timeout(**base_kwargs, args=(1e-2,), timeout_sec=1e-4)
self.assertFalse(res.success)
self.assertEqual(res.nit, 1) # only one call to the callback is made

Expand Down

0 comments on commit 23cdfd7

Please sign in to comment.