diff --git a/brainpy/_src/dynold/synapses/base.py b/brainpy/_src/dynold/synapses/base.py index 5373b59a3..5bdfc7bbd 100644 --- a/brainpy/_src/dynold/synapses/base.py +++ b/brainpy/_src/dynold/synapses/base.py @@ -303,7 +303,7 @@ def __init__( # synaptic communications if isinstance(conn, All2All): - self.comm = linear.AllToAll(pre.num, post.num, g_max) + self.comm = linear.AllToAll(pre.num, post.num, g_max, include_self=conn.include_self) elif isinstance(conn, One2One): assert post.num == pre.num self.comm = linear.OneToOne(pre.num, g_max) diff --git a/brainpy/_src/dynold/synapses/tests/test_dynold_base_synapse.py b/brainpy/_src/dynold/synapses/tests/test_dynold_base_synapse.py new file mode 100644 index 000000000..9dc755586 --- /dev/null +++ b/brainpy/_src/dynold/synapses/tests/test_dynold_base_synapse.py @@ -0,0 +1,12 @@ + +import unittest +import brainpy as bp + + +class Test_TwoEndConnAlignPre(unittest.TestCase): + def test1(self): + E = bp.neurons.HH(size=4) + syn = bp.synapses.AMPA(E, E, bp.conn.All2All(include_self=False)) + self.assertTrue(syn.conn.include_self == syn.comm.include_self) + +