From c9d6b80ed386948a6ee39566585e2ccffcccbeb9 Mon Sep 17 00:00:00 2001 From: Filippo Airaldi Date: Sun, 24 Nov 2024 17:34:11 +0100 Subject: [PATCH] fixing tests --- tests/test_problems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_problems.py b/tests/test_problems.py index ba393b4..623131a 100644 --- a/tests/test_problems.py +++ b/tests/test_problems.py @@ -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}"