Skip to content

Commit edfa813

Browse files
authored
Merge pull request #24 from ZedongPeng/remove_bcoo_fromdense
Fix: remove the support of bcoo.fromdense
2 parents 8fcce37 + 097d4d9 commit edfa813

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

mpax/mp_io.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ def transform_to_bcoo(input_matrix):
183183
ValueError
184184
The input matrix format is not supported.
185185
"""
186-
if isinstance(input_matrix, (jnp.ndarray, np.ndarray)):
187-
bcoo_matrix = BCOO.fromdense(
188-
input_matrix, nse=input_matrix.shape[0] * input_matrix.shape[1]
189-
)
190-
elif isinstance(input_matrix, BCSR):
186+
if isinstance(input_matrix, BCSR):
191187
bcoo_matrix = input_matrix.to_bcoo()
192188
elif isinstance(input_matrix, (sparray, spmatrix)):
193189
bcoo_matrix = BCOO.from_scipy_sparse(input_matrix)
@@ -196,8 +192,8 @@ def transform_to_bcoo(input_matrix):
196192
else:
197193
raise ValueError(
198194
"Unsupported matrix format. "
199-
"The constraint matrix must be one of the following types: "
200-
"jnp.ndarray, numpy.ndarray, BCOO, or BCSR."
195+
"The sparse constraint matrix must be one of the following types: "
196+
"scipy.sparse.sparray, scipy.sparse.spmatrix, BCOO, or BCSR."
201197
)
202198
return bcoo_matrix
203199

0 commit comments

Comments
 (0)