Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoAiraldi committed Nov 24, 2024
1 parent 17bc3b2 commit c9d6b80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_optimal_value_and_point(self, cls: type):
if problem._optimizers is not None:
tol = 2e0 if isinstance(problem, HyperTuningGridTestFunction) else 1e-4
for i, x_opt in enumerate(problem._optimizers):
f_computed = problem(torch.as_tensor(x_opt))
f_computed = problem(torch.as_tensor(x_opt).view(1, -1))
expected_ = torch.as_tensor(expected).view_as(f_computed).to(f_computed)
torch.testing.assert_close(
f_computed, expected_, rtol=tol, atol=tol, msg=f"{name} x_opt {i}"
Expand Down

0 comments on commit c9d6b80

Please sign in to comment.