diff --git a/brainpy/connect/tests/test_regular_conn.py b/brainpy/connect/tests/test_regular_conn.py index f2f464670..f6d9e79a7 100644 --- a/brainpy/connect/tests/test_regular_conn.py +++ b/brainpy/connect/tests/test_regular_conn.py @@ -14,7 +14,7 @@ def test_one2one(): num = bp.tools.size2num(size) actual_mat = bp.math.zeros((num, num), dtype=bp.math.bool_) - actual_mat = bp.math.fill_diagonal(actual_mat, True) + bp.math.fill_diagonal(actual_mat, True) assert bp.math.array_equal(actual_mat, conn_mat) assert bp.math.array_equal(pre_ids, bp.math.arange(num)) @@ -42,7 +42,7 @@ def test_all2all(): print(mat) actual_mat = bp.math.ones((num, num), dtype=bp.math.bool_) if not has_self: - actual_mat = bp.math.fill_diagonal(actual_mat, False) + bp.math.fill_diagonal(actual_mat, False) assert bp.math.array_equal(actual_mat, mat) diff --git a/brainpy/math/delay_vars.py b/brainpy/math/delay_vars.py index 4b2ffb3b4..a18a7c5bd 100644 --- a/brainpy/math/delay_vars.py +++ b/brainpy/math/delay_vars.py @@ -168,6 +168,7 @@ def __init__( def _check_time(self, times, transforms): prev_time, current_time = times + current_time = current_time[0] if prev_time > current_time + 1e-6: raise ValueError(f'\n' f'!!! Error in {self.__class__.__name__}: \n' @@ -194,7 +195,7 @@ def __call__(self, time, indices=None): return self._after_t0(time) def _after_t0(self, prev_time): - diff = self.delay_len - (self.current_time - prev_time) + diff = self.delay_len - (self.current_time[0] - prev_time) if isinstance(diff, ndarray): diff = diff.value if self.interp_method == _INTERP_LINEAR: