class_docstr: COOrdinate format sparse matrix.
  
  This can be instantiated in several ways.
  
  ``coo_matrix(D)``
      ``D`` is a rank-2 :class:`cupy.ndarray`.
  
  ``coo_matrix(S)``
      ``S`` is another sparse matrix. It is equivalent to ``S.tocoo()``.
  
  ``coo_matrix((M, N), [dtype])``
      It constructs an empty matrix whose shape is ``(M, N)``. Default dtype
      is float64.
  
  ``coo_matrix((data, (row, col)))``
      All ``data``, ``row`` and ``col`` are one-dimenaional
      :class:`cupy.ndarray`.
  
  Args:
      arg1: Arguments for the initializer.
      shape (tuple): Shape of a matrix. Its length must be two.
      dtype: Data type. It must be an argument of :class:`numpy.dtype`.
      copy (bool): If ``True``, copies of given data are always used.
  
  .. seealso::
     :class:`scipy.sparse.coo_matrix`
class_docstr_tok: ["COOrdinate","format","sparse","matrix",".","This","can","be","instantiated","in","several","ways",".","``","coo_matrix","(","D",")","``","``","D","``","is","a","rank-2",":","class",":","`","cupy.ndarray","`",".","``","coo_matrix","(","S",")","``","``","S","``","is","another","sparse","matrix",".","It","is","equivalent","to","``","S.tocoo","(",")","``",".","``","coo_matrix","(","(","M",",","N",")",",","[","dtype","]",")","``","It","constructs","an","empty","matrix","whose","shape","is","``","(","M",",","N",")","``",".","Default","dtype","is","float64",".","``","coo_matrix","(","(","data",",","(","row",",","col",")",")",")","``","All","``","data","``",",","``","row","``","and","``","col","``","are","one-dimenaional",":","class",":","`","cupy.ndarray","`",".","Args",":","arg1",":","Arguments","for","the","initializer",".","shape","(","tuple",")",":","Shape","of","a","matrix",".","Its","length","must","be","two",".","dtype",":","Data","type",".","It","must","be","an","argument","of",":","class",":","`","numpy.dtype","`",".","copy","(","bool",")",":","If","``","True","``",",","copies","of","given","data","are","always","used",".","..","seealso",":",":",":","class",":","`","scipy.sparse.coo_matrix","`"]
docstr: Gives a new shape to a sparse matrix without changing its data.
  
  Args:
      shape (tuple):
          The new shape should be compatible with the original shape.
      order: {'C', 'F'} (optional)
          Read the elements using this index order. 'C' means to read and
          write the elements using C-like index order. 'F' means to read
          and write the elements using Fortran-like index order. Default:
          C.
  
  Returns:
      cupyx.scipy.sparse.coo_matrix: sparse matrix
docstr_tok: ["Gives","a","new","shape","to","a","sparse","matrix","without","changing","its","data",".","Args",":","shape","(","tuple",")",":","The","new","shape","should","be","compatible","with","the","original","shape",".","order",":","{","'","C","'",",","'","F","'","}","(","optional",")","Read","the","elements","using","this","index","order",".","'","C","'","means","to","read","and","write","the","elements","using","C-like","index","order",".","'","F","'","means","to","read","and","write","the","elements","using","Fortran-like","index","order",".","Default",":","C.","Returns",":","cupyx.scipy.sparse.coo_matrix",":","sparse","matrix"]
code: def reshape(self, *shape, order="C"):
      """Gives a new shape to a sparse matrix without changing its data.
  
      Args:
          shape (tuple):
              The new shape should be compatible with the original shape.
          order: {'C', 'F'} (optional)
              Read the elements using this index order. 'C' means to read and
              write the elements using C-like index order. 'F' means to read
              and write the elements using Fortran-like index order. Default:
              C.
  
      Returns:
          cupyx.scipy.sparse.coo_matrix: sparse matrix
  
      """
  
      shape = _sputils.check_shape(shape, self.shape)
  
      if shape == self.shape:
          return self
  
      nrows, ncols = self.shape
  
      if order == "C":  # C to represent matrix in row major format
          dtype = _sputils.get_index_dtype(
              maxval=(ncols * max(0, nrows - 1) + max(0, ncols - 1))
          )
          flat_indices = (
              cupy.multiply(ncols, self.row, dtype=dtype) + self.col
          )
          new_row, new_col = divmod(flat_indices, shape[1])
      elif order == "F":
          dtype = _sputils.get_index_dtype(
              maxval=(ncols * max(0, nrows - 1) + max(0, ncols - 1))
          )
          flat_indices = (
              cupy.multiply(ncols, self.row, dtype=dtype) + self.row
          )
          new_col, new_row = divmod(flat_indices, shape[0])
      else:
          raise ValueError("'order' must be 'C' or 'F'")
  
      new_data = self.data
  
      return coo_matrix(
          (new_data, (new_row, new_col)), shape=shape, copy=False
      )
  
imports: import numpy
  import cupy
  from cupy import _core
  from cupyx.scipy.sparse import _base
  from cupyx.scipy.sparse import _csc
  from cupyx.scipy.sparse import _csr
  from cupyx.scipy.sparse import _data
  from cupyx.scipy.sparse import _util
  from cupyx.scipy.sparse import _sputils
label_desc: Use image node_id 9 for calling the coo_matrix obj's underlying member method code with example usage: obj.reshape() and returns: coo_matrix, self