Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

cupy / cupy Public

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with cupy sparse? #1261

PM1980 opened this issue May 22, 2018 · 4 comments

Possible issue with cupy sparse? #1261

PM1980 opened this issue May 22, 2018 · 4 comments st:awaiting-author Awaiting response from author

Comments

PM1980 commented May 22, 2018

I am trying to build a sparse matrix using Cupy. For some reason the same matrix is stored using Scipy, but fails whenever cupy sparse is called.

import numpy as np import cupy as cp import cupy.sparse from scipy.sparse import csc_matrix 
row1 = np.array([0, 2, 2, 0, 1, 2]) col1 = np.array([0, 0, 1, 2, 2, 2]) data1 = np.array([1., 2., 3., 4., 5., 6.]) test1=csc_matrix((data1, (row1, col1)), shape=(3, 3)) 
row2 = cp.array(row1) col2 = cp.array(col1) data2 = cp.array(data1) test2=cupy.sparse.csc_matrix((data2, (row2, col2)), shape=(3, 3)) 

This code assigns variable "test1" and fails on "test2" with the following message:

Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/paulo/.spyder-py3/temp.py', wdir='C:/Users/paulo/.spyder-py3')

File "C:\Users\paulo\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Users\paulo\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/paulo/.spyder-py3/temp.py", line 55, in
teste2=cupy.sparse.csc_matrix((data2, (row2, col2)), shape=(3, 3))

File "C:\Users\paulo\Anaconda3\lib\site-packages\cupy\sparse\compressed.py", line 95, in init
'Unsupported initializer format')

ValueError: Unsupported initializer format

Am I doing something wrong? Thanks!
Regards,
Paulo

The text was updated successfully, but these errors were encountered: