-
import scipy
import scipy.sparse
from scipy.sparse import random as sp_rand
from tqdm import tqdm, trange
import jax
from jax.experimental import sparse
my_sp_mat_list = [ sp_rand(2000, 2000, density=0.01) for i in trange(500)]
my_sp_mat_list_jax = [sparse.BCOO.fromdense( H.toarray() ) for H in tqdm(my_sp_mat_list)] I wonder if there is a way to directly convert the sparse matrix in |
Beta Was this translation helpful? Give feedback.
Answered by
jakevdp
Apr 22, 2022
Replies: 1 comment 7 replies
-
You can use my_sp_mat_list_jax = [sparse.BCOO.from_scipy_sparse(H) for H in my_sp_mat_list] |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
JiahaoYao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
BCOO.from_scipy_sparse
: