class_docstr: Experimental COO matrix implemented in JAX.
  
  Note: this class has minimal compatibility with JAX transforms such as
  grad and autodiff, and offers very little functionality. In general you
  should prefer :class:`jax.experimental.sparse.BCOO`.
  
  Additionally, there are known failures in the case that `nse` is larger
  than the true number of nonzeros in the represented matrix. This situation
  is better handled in BCOO.
class_docstr_tok: ["Experimental","COO","matrix","implemented","in","JAX",".","Note",":","this","class","has","minimal","compatibility","with","JAX","transforms","such","as","grad","and","autodiff",",","and","offers","very","little","functionality",".","In","general","you","should","prefer",":","class",":","`","jax.experimental.sparse.BCOO","`",".","Additionally",",","there","are","known","failures","in","the","case","that","`","nse","`","is","larger","than","the","true","number","of","nonzeros","in","the","represented","matrix",".","This","situation","is","better","handled","in","BCOO","."]
docstr: Return a copy of the COO matrix with sorted indices.
  
  The matrix is sorted by row indices and column indices per row.
  If self._rows_sorted is True, this returns ``self`` without a copy.
docstr_tok: ["Return","a","copy","of","the","COO","matrix","with","sorted","indices",".","The","matrix","is","sorted","by","row","indices","and","column","indices","per","row",".","If","self._rows_sorted","is","True",",","this","returns","``","self","``","without","a","copy","."]
code: def _sort_indices(self) -> COO:
      """Return a copy of the COO matrix with sorted indices.
  
      The matrix is sorted by row indices and column indices per row.
      If self._rows_sorted is True, this returns ``self`` without a copy.
      """
      # TODO(jakevdp): would be benefit from lowering this to cusparse sort_rows utility?
      if self._rows_sorted:
          return self
      row, col, data = lax.sort(
          (self.row, self.col, self.data), num_keys=2
      )
      return self.__class__(
          (data, row, col), shape=self.shape, rows_sorted=True
      )
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from functools import partial
  import operator
  from typing import Any, NamedTuple
  import warnings
  import numpy
  import jax
  from jax import lax
  from jax.interpreters import mlir
  from jax.experimental.sparse._base import JAXSparse
  from jax.experimental.sparse.util import _coo_extract, CuSparseEfficiencyWarning
  from jax import tree_util
  from jax._src import core
  from jax._src import dispatch
  from jax._src.interpreters import ad
  from jax._src.lax.lax import _const
  from jax._src.lib.mlir.dialects import hlo
  from jax._src.lib import gpu_sparse
  from jax._src.numpy.util import promote_dtypes
  from jax._src.typing import Array, ArrayLike, DTypeLike
  import jax.numpy
label_desc: Use image node_id 3 for calling the COO obj's underlying member method code with example usage: obj._sort_indices() and returns: self, self