diff --git a/brainpy/dyn/synapses/abstract_models.py b/brainpy/dyn/synapses/abstract_models.py index 6a7c59dc3..b279c1766 100644 --- a/brainpy/dyn/synapses/abstract_models.py +++ b/brainpy/dyn/synapses/abstract_models.py @@ -348,8 +348,7 @@ def update(self, _t, _dt): post_vs = post_vs - pre_spike post_vs = self.g_max * post_vs else: - post_vs = bm.expand_dims(pre_spike, 1) * self.g_max - post_vs = post_vs.sum(axis=0) + post_vs = pre_spike @ self.g_max elif isinstance(self.conn, One2One): post_vs = pre_spike * self.g_max else: @@ -667,8 +666,7 @@ def update(self, _t, _dt): post_vs = post_vs - self.g post_vs = self.g_max * post_vs else: - post_vs = bm.expand_dims(self.g, 1) * self.g_max - post_vs = post_vs.sum(axis=0) + post_vs = self.g @ self.g_max elif isinstance(self.conn, One2One): post_vs = self.g_max * self.g else: @@ -1230,8 +1228,7 @@ def update(self, _t, _dt): if not self.conn.include_self: post_g = post_g - self.g else: - post_g = bm.expand_dims(self.g, 1) * self.g_max - post_g = post_g.sum(axis=0) + post_g = self.g * self.g_max elif isinstance(self.conn, One2One): post_g = self.g_max * self.g else: diff --git a/brainpy/dyn/synapses/biological_models.py b/brainpy/dyn/synapses/biological_models.py index 5726e7f14..b93bd2e2d 100644 --- a/brainpy/dyn/synapses/biological_models.py +++ b/brainpy/dyn/synapses/biological_models.py @@ -206,8 +206,7 @@ def update(self, _t, _dt): if not self.conn.include_self: post_g = post_g - self.g else: - post_g = bm.expand_dims(self.g, 1) * self.g_max - post_g = post_g.sum(axis=0) + post_g = self.g @ self.g_max else: if self.conn_type == 'sparse': post_g = bm.pre2post_sum(self.g, self.post.num, self.post_ids, self.pre_ids)