From aadf8ae2689bb0d3770e318c855f2fac7e30e77f Mon Sep 17 00:00:00 2001 From: chaoming Date: Thu, 31 Aug 2023 17:20:59 +0800 Subject: [PATCH] [fix] fix #466 --- brainpy/_src/dynold/synapses/base.py | 2 +- .../synapses/tests/test_dynold_base_synapse.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 brainpy/_src/dynold/synapses/tests/test_dynold_base_synapse.py 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) + +