Skip to content
New issue

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

[bug] fix brainpy.connect.FixedProb bug #376

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion brainpy/_src/connect/random_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def build_mat(self):
mat = (self._jaxrand.uniform(size=(self.pre_num, self.post_num)) < self.prob) * pre_state
mat = bm.asarray(mat)
if not self.include_self:
mat = bm.fill_diagonal(mat, False)
bm.fill_diagonal(mat, False)
return mat.astype(MAT_DTYPE)


Expand Down
18 changes: 18 additions & 0 deletions brainpy/_src/layers/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,21 @@ def __init__(self, *args, **kwargs) -> None:

def update(self, x):
return x


class CSRLinear(Layer):
pass


class CSCLinear(Layer):
pass


class BSRLinear(Layer):
pass


class MatLinear(Layer):
pass


Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import jax
import pytest

import test_csrmv
import test_event_csrmv

if jax.default_backend() != 'gpu':
pytest.skip("No gpu available.", allow_module_level=True)


class Test_event_csr_matvec_GPU(test_csrmv.Test_event_csr_matvec):
class Test_event_csr_matvec_GPU(test_event_csrmv.Test_event_csr_matvec):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs, platform='gpu')
Loading