Skip to content

Commit 2ae560e

Browse files
committed
fix: np.asarray.astype
1 parent 5f3106b commit 2ae560e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

brainpy/connect/custom_conn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def __init__(self, i, j):
4747
assert i.size == j.size
4848

4949
# initialize the class via "pre_ids" and "post_ids"
50-
self.pre_ids = np.asarray(i, dtype=IDX_DTYPE)
51-
self.post_ids = np.asarray(j, dtype=IDX_DTYPE)
50+
self.pre_ids = np.asarray(i).astype(IDX_DTYPE)
51+
self.post_ids = np.asarray(j).astype(IDX_DTYPE)
5252

5353
def __call__(self, pre_size, post_size):
5454
super(IJConn, self).__call__(pre_size, post_size)
@@ -80,7 +80,7 @@ def __init__(self, csr_mat):
8080
f'Please run "pip install scipy" to install scipy.')
8181

8282
assert isinstance(csr_mat, csr_matrix)
83-
csr_mat.data = np.asarray(csr_mat.data, dtype=MAT_DTYPE)
83+
csr_mat.data = np.asarray(csr_mat.data).astype(MAT_DTYPE)
8484
self.csr_mat = csr_mat
8585
self.pre_num, self.post_num = csr_mat.shape
8686

0 commit comments

Comments
 (0)