Skip to content

Commit 98fc202

Browse files
dance858Transurgeon
authored andcommitted
flattening
1 parent 9fbc3ae commit 98fc202

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cvxpy/reductions/solvers/nlp_solvers/diff_engine/converters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _convert_matmul(expr, children):
4848
if left_arg.is_constant():
4949
A = left_arg.value
5050

51-
if sparse.issparse(A) or True:
51+
if sparse.issparse(A):
5252
if not isinstance(A, sparse.csr_matrix):
5353
A = sparse.csr_matrix(A)
5454

@@ -63,14 +63,14 @@ def _convert_matmul(expr, children):
6363
else:
6464
return _diffengine.make_dense_left_matmul(
6565
children[1],
66-
A.flatten(order='F'),
66+
A.flatten(order='C'),
6767
A.shape[0],
6868
A.shape[1],
6969
)
7070
elif right_arg.is_constant():
7171
A = right_arg.value
7272

73-
if sparse.issparse(A) or True:
73+
if sparse.issparse(A):
7474
if not isinstance(A, sparse.csr_matrix):
7575
A = sparse.csr_matrix(A)
7676

@@ -85,7 +85,7 @@ def _convert_matmul(expr, children):
8585
else:
8686
return _diffengine.make_dense_right_matmul(
8787
children[0],
88-
A.flatten(order='F'),
88+
A.flatten(order='C'),
8989
A.shape[0],
9090
A.shape[1],
9191
)

cvxpy/tests/nlp_tests/derivative_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def check_constraint_values(self, x=None):
8989
python_values.append(constr_val)
9090

9191
python_values = np.hstack(python_values) if python_values else np.array([])
92-
9392
match = np.allclose(c_values, python_values, rtol=1e-10, atol=1e-10)
9493
return match
9594

0 commit comments

Comments
 (0)