Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_dual_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_dual_gradcheck_inequality():

# Function that returns dual variable for gradcheck
def f(c_t):
x_opt, ineq_dual = layer(c_t)
x_opt, ineq_dual = layer(c_t, solver_args={"eps": 1e-10})
return ineq_dual

c_t = torch.tensor([1.0, -1.0], requires_grad=True)
Expand Down Expand Up @@ -303,7 +303,7 @@ def test_dual_gradcheck_vector_equality():
)

def f(A_t, b_t):
x_opt, eq_dual = layer(A_t, b_t)
x_opt, eq_dual = layer(A_t, b_t, solver_args={"eps": 1e-10})
return eq_dual.sum()

torch.manual_seed(42)
Expand Down
5 changes: 4 additions & 1 deletion tests/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ def test_sdp():
# Use a well-conditioned symmetric matrix
C_t = torch.tensor([[2.0, 0.5, 0.1], [0.5, 3.0, 0.2], [0.1, 0.2, 1.5]], requires_grad=True)

torch.autograd.gradcheck(layer, (C_t,), atol=1e-4, rtol=1e-3)
torch.autograd.gradcheck(
lambda C: layer(C, solver_args={"eps": 1e-10}),
(C_t,), atol=1e-4, rtol=1e-3,
)


def test_not_enough_parameters():
Expand Down
Loading