Skip to content

Commit

Permalink
[sparse] fix coo efficiency warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevdp committed Mar 27, 2023
1 parent 40fb646 commit 392bd93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jax/experimental/sparse/coo.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _coo_todense_gpu_lowering(coo_todense_hlo, ctx, data, row, col, *, spinfo):
shape = spinfo.shape[::-1]
else:
warnings.warn("coo_todense GPU lowering requires matrices with sorted rows or sorted cols. "
"To sort the rows in your matrix, use e.g. mat = mat._sort_rows(). Falling "
"To sort the rows in your matrix, use e.g. mat = mat._sort_indices(). Falling "
"back to the default implementation.", CuSparseEfficiencyWarning)
return _coo_todense_lowering(ctx, data, row, col, spinfo=spinfo)

Expand Down Expand Up @@ -460,7 +460,7 @@ def _coo_matvec_gpu_lowering(coo_matvec_hlo, ctx, data, row, col, v, *, spinfo,
shape = spinfo.shape[::-1]
else:
warnings.warn("coo_matvec GPU lowering requires matrices with sorted rows or sorted cols. "
"To sort the rows in your matrix, use e.g. mat = mat._sort_rows(). Falling "
"To sort the rows in your matrix, use e.g. mat = mat._sort_indices(). Falling "
"back to the default implementation.", CuSparseEfficiencyWarning)
return _coo_matvec_lowering(ctx, data, row, col, v, spinfo=spinfo,
transpose=transpose)
Expand Down Expand Up @@ -583,7 +583,7 @@ def _coo_matmat_gpu_lowering(coo_matmat_hlo, ctx, data, row, col, B, *, spinfo,
shape = spinfo.shape[::-1]
else:
warnings.warn("coo_matmat GPU lowering requires matrices with sorted rows or sorted cols. "
"To sort the rows in your matrix, use e.g. mat = mat._sort_rows(). Falling "
"To sort the rows in your matrix, use e.g. mat = mat._sort_indices(). Falling "
"back to the default implementation.", CuSparseEfficiencyWarning)
return _coo_matmat_lowering(ctx, data, row, col, B, spinfo=spinfo,
transpose=transpose)
Expand Down

0 comments on commit 392bd93

Please sign in to comment.