Skip to content

Commit 6f8e651

Browse files
authored
Intergate brainpylib operators into brainpy (#352)
Intergate brainpylib operators into brainpy #352
2 parents d67e79b + ac37bd4 commit 6f8e651

File tree

74 files changed

+852
-8522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+852
-8522
lines changed

CMakeLists.txt

Lines changed: 0 additions & 77 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ BrainPy is a flexible, efficient, and extensible framework for computational neu
2929
## Ecosystem
3030

3131
- **[BrainPy](https://github.com/brainpy/BrainPy)**: The solution for the general-purpose brain dynamics programming.
32-
- **[brainpylib](https://github.com/brainpy/brainpylib)**: Efficient operators for the sparse and event-driven computation.
3332
- **[brainpy-examples](https://github.com/brainpy/examples)**: Comprehensive examples of BrainPy computation.
3433
- **[brainpy-datasets](https://github.com/brainpy/datasets)**: Neuromorphic and Cognitive Datasets for Brain Dynamics Modeling.
3534

brainpy/_src/dyn/synapses/abstract_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def update(self, tdi, pre_spike=None):
153153
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
154154
else:
155155
if self.comp_method == 'sparse':
156-
f = lambda s: bm.event_ops.event_csr_matvec(
156+
f = lambda s: bm.event_csr_matvec(
157157
self.g_max, self.conn_mask[0], self.conn_mask[1], s,
158158
shape=(self.pre.num, self.post.num), transpose=True
159159
)
@@ -344,7 +344,7 @@ def update(self, tdi, pre_spike=None):
344344
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
345345
else:
346346
if self.comp_method == 'sparse':
347-
f = lambda s: bm.event_ops.event_csr_matvec(
347+
f = lambda s: bm.event_csr_matvec(
348348
self.g_max, self.conn_mask[0], self.conn_mask[1], s,
349349
shape=(self.pre.num, self.post.num),
350350
transpose=True
@@ -549,7 +549,7 @@ def update(self, tdi, pre_spike=None):
549549
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
550550
else:
551551
if self.comp_method == 'sparse':
552-
f = lambda s: bm.sparse_ops.cusparse_csr_matvec(
552+
f = lambda s: bm.cusparse_csr_matvec(
553553
self.g_max, self.conn_mask[0], self.conn_mask[1], s,
554554
shape=(self.pre.num, self.post.num),
555555
transpose=True
@@ -894,7 +894,7 @@ def update(self, tdi, pre_spike=None):
894894
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
895895
else:
896896
if self.comp_method == 'sparse':
897-
f = lambda s: bm.event_ops.event_csr_matvec(
897+
f = lambda s: bm.event_csr_matvec(
898898
self.g_max, self.conn_mask[0], self.conn_mask[1], s,
899899
shape=(self.pre.num, self.post.num),
900900
transpose=True

brainpy/_src/dyn/synapses/biological_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def update(self, tdi, pre_spike=None):
230230
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
231231
else:
232232
if self.comp_method == 'sparse':
233-
f = lambda s: bm.sparse_ops.cusparse_csr_matvec(
233+
f = lambda s: bm.cusparse_csr_matvec(
234234
self.g_max, self.conn_mask[0], self.conn_mask[1], s,
235235
shape=(self.pre.num, self.post.num),
236236
transpose=True
@@ -574,7 +574,7 @@ def update(self, tdi, pre_spike=None):
574574
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
575575
else:
576576
if self.comp_method == 'sparse':
577-
f = lambda s: bm.sparse_ops.cusparse_csr_matvec(
577+
f = lambda s: bm.cusparse_csr_matvec(
578578
self.g_max,self.conn_mask[0], self.conn_mask[1], s,
579579
shape=(self.pre.num, self.post.num),
580580
transpose=True

brainpy/_src/dyn/synapses_v2/abstract_synapses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def update(self, pre_spike, post_v=None):
121121
else:
122122
if self.comp_method == 'sparse':
123123
if self.stp is None:
124-
f = lambda s: bm.event_ops.event_csr_matvec(self.g_max,
124+
f = lambda s: bm.event_csr_matvec(self.g_max,
125125
self.conn_mask[0],
126126
self.conn_mask[1],
127127
s,
@@ -130,7 +130,7 @@ def update(self, pre_spike, post_v=None):
130130
if isinstance(self.mode, bm.BatchingMode):
131131
f = vmap(f)
132132
else:
133-
f = lambda s: bm.sparse_ops.cusparse_csr_matvec(self.g_max,
133+
f = lambda s: bm.cusparse_csr_matvec(self.g_max,
134134
self.conn_mask[0],
135135
self.conn_mask[1],
136136
s,
@@ -276,7 +276,7 @@ def update(self, pre_spike, post_v=None):
276276
post_vs = self._syn2post_with_one2one(syn_value, self.g_max)
277277
else:
278278
if self.comp_method == 'sparse':
279-
f = lambda s: bm.sparse_ops.cusparse_csr_matvec(
279+
f = lambda s: bm.cusparse_csr_matvec(
280280
self.g_max,
281281
self.conn_mask[0],
282282
self.conn_mask[1],

brainpy/_src/math/operators/__init__.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,9 @@
44
Operators for brain dynamics modeling.
55
"""
66

7-
from .check import *
8-
from .errors import *
9-
from .tools import *
10-
from .register_custom_calls import *
11-
12-
13-
from . import (
14-
event_ops,
15-
sparse_ops,
16-
jitconn_ops,
17-
op_registers,
18-
compat,
19-
pre_syn_post,
20-
sparse_matmul
21-
)
22-
23-
__all__ = (
24-
event_ops.__all__
25-
+ sparse_ops.__all__
26-
+ jitconn_ops.__all__
27-
+ op_registers.__all__
28-
+ compat.__all__
29-
+ pre_syn_post.__all__
30-
+ sparse_matmul.__all__
31-
)
32-
337

348
from .event_ops import *
359
from .sparse_ops import *
3610
from .jitconn_ops import *
3711
from .op_registers import *
38-
from .compat import *
39-
from .sparse_matmul import *
40-
from .pre_syn_post import *
12+
from .pre_syn_post import *

brainpy/_src/math/operators/check.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

brainpy/_src/math/operators/compat/__init__.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)