Skip to content

Commit 99f22b6

Browse files
authored
fix brainpylib call bug (#354)
fix brainpylib call bug (#354)
2 parents 6f8e651 + 62f4ccc commit 99f22b6

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

brainpy/_src/math/operators/jitconn_ops.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ def matmat_prob_conn_normal_weight(
262262
The output of :math:`y = M @ v`.
263263
"""
264264
bl = tools.import_brainpylib()
265-
return bl.matmat_prob_normal_p(matrix,
266-
w_mu=w_mu,
267-
w_sigma=w_sigma,
268-
conn_prob=conn_prob,
269-
shape=shape,
270-
seed=seed,
271-
version=version)
265+
return bl.jitconn_ops.matmat_prob_conn_normal_weight(matrix,
266+
w_mu=w_mu,
267+
w_sigma=w_sigma,
268+
conn_prob=conn_prob,
269+
shape=shape,
270+
seed=seed,
271+
version=version)
272272

273273

274274
def matvec_prob_conn_homo_weight(

brainpy/_src/math/operators/sparse_ops.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ def cusparse_csr_matvec(
6060
the matrix vector product.
6161
"""
6262
bl = tools.import_brainpylib()
63-
return bl.cusparse_csr_matvec(data, indices, indptr, vector, shape=shape, transpose=transpose)
63+
return bl.sparse_ops.cusparse_csr_matvec(data,
64+
indices,
65+
indptr,
66+
vector,
67+
shape=shape,
68+
transpose=transpose)
6469

6570

6671
def cusparse_coo_matvec(
@@ -107,14 +112,14 @@ def cusparse_coo_matvec(
107112
the matrix vector product.
108113
"""
109114
bl = tools.import_brainpylib()
110-
return bl.cusparse_coo_matvec(data,
111-
row,
112-
col,
113-
vector,
114-
shape=shape,
115-
rows_sorted=rows_sorted,
116-
cols_sorted=cols_sorted,
117-
transpose=transpose)
115+
return bl.sparse_ops.cusparse_coo_matvec(data,
116+
row,
117+
col,
118+
vector,
119+
shape=shape,
120+
rows_sorted=rows_sorted,
121+
cols_sorted=cols_sorted,
122+
transpose=transpose)
118123

119124

120125
def csr_matvec(
@@ -144,9 +149,6 @@ def csr_matvec(
144149
and dtype ``data.dtype``.
145150
shape: tuple of int
146151
A length-2 tuple representing the matrix shape.
147-
transpose: bool
148-
A boolean specifying whether to transpose the sparse matrix
149-
before computing.
150152
method: str
151153
The computing method used in GPU backend. Currently, we support
152154
`scalar`, `vector` and `adaptive`.
@@ -158,7 +160,7 @@ def csr_matvec(
158160
the matrix vector product.
159161
"""
160162
bl = tools.import_brainpylib()
161-
return bl.csr_matvec(data, indices, indptr, vector, shape=shape)
163+
return bl.sparse_ops.csr_matvec(data, indices, indptr, vector, shape=shape, method=method)
162164

163165

164166
def _matmul_with_left_sparse(

0 commit comments

Comments
 (0)