class_docstr: Sparse matrix with DIAgonal storage.
  
  Now it has only one initializer format below:
  
  ``dia_matrix((data, offsets))``
  
  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 arrays are always used.
  
  .. seealso::
     :class:`scipy.sparse.dia_matrix`
class_docstr_tok: ["Sparse","matrix","with","DIAgonal","storage",".","Now","it","has","only","one","initializer","format","below",":","``","dia_matrix","(","(","data",",","offsets",")",")","``","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","arrays","are","always","used",".","..","seealso",":",":",":","class",":","`","scipy.sparse.dia_matrix","`"]
docstr: Converts the matrix to Compressed Sparse Column format.
  
  Args:
      copy (bool): If ``False``, it shares data arrays as much as
          possible. Actually this option is ignored because all
          arrays in a matrix cannot be shared in dia to csc conversion.
  
  Returns:
      cupyx.scipy.sparse.csc_matrix: Converted matrix.
docstr_tok: ["Converts","the","matrix","to","Compressed","Sparse","Column","format",".","Args",":","copy","(","bool",")",":","If","``","False","``",",","it","shares","data","arrays","as","much","as","possible",".","Actually","this","option","is","ignored","because","all","arrays","in","a","matrix","can","not","be","shared","in","dia","to","csc","conversion",".","Returns",":","cupyx.scipy.sparse.csc_matrix",":","Converted","matrix","."]
code: def tocsc(self, copy=False):
      """Converts the matrix to Compressed Sparse Column format.
  
      Args:
          copy (bool): If ``False``, it shares data arrays as much as
              possible. Actually this option is ignored because all
              arrays in a matrix cannot be shared in dia to csc conversion.
  
      Returns:
          cupyx.scipy.sparse.csc_matrix: Converted matrix.
  
      """
      if self.data.size == 0:
          return _csc.csc_matrix(self.shape, dtype=self.dtype)
  
      num_rows, num_cols = self.shape
      num_offsets, offset_len = self.data.shape
  
      row, mask = _core.ElementwiseKernel(
          "int32 offset_len, int32 offsets, int32 num_rows, "
          "int32 num_cols, T data",
          "int32 row, bool mask",
          """
              int offset_inds = i % offset_len;
              row = offset_inds - offsets;
              mask = (row >= 0 && row < num_rows && offset_inds < num_cols
                      && data != T(0));
              """,
          "cupyx_scipy_sparse_dia_tocsc",
      )(
          offset_len,
          self.offsets[:, None],
          num_rows,
          num_cols,
          self.data,
      )
      indptr = cupy.zeros(num_cols + 1, dtype="i")
      indptr[1 : offset_len + 1] = cupy.cumsum(mask.sum(axis=0))
      indptr[offset_len + 1 :] = indptr[offset_len]
      indices = row.T[mask.T].astype("i", copy=False)
      data = self.data.T[mask.T]
      return _csc.csc_matrix(
          (data, indices, indptr), shape=self.shape, dtype=self.dtype
      )
  
file_path: cupy/cupyx/scipy/sparse/_dia.py
imports: import cupy
  from cupy import _core
  from cupyx.scipy.sparse import _csc
  from cupyx.scipy.sparse import _data
  from cupyx.scipy.sparse import _util
label_desc: Use image node_id 7 for calling the dia_matrix obj's underlying member method code with example usage: obj.tocsc(copy) and returns: _csc, _csc