I digged the documentation for cupy
sparse matrix.
as in scipy
I expect to have something like this:
from scipy.sparse import csr_matrix
A_csr = csr_matrix([[1, 2, 0], [0, 0, 3], [4, 0, 5]])
but in cupy
here:
To convert CuPy ndarray to CuPy sparse matrices, pass it to the constructor of each CuPy sparse matrix class.
# from cupy.sparse import csr_matrix as cp_csr_matrix
from cupyx.scipy.sparse import csr_matrix as cp_csr_matrix
cA = cp.array([[1, 2, 0], [0, 0, 3], [4, 0, 5]])
cA_csr = cp_csr_matrix(cA)
return :
ValueError: Only bool, float32, float64, complex64 and complex128 are supported
I also found this answer which give the same error.