From 757fd1df6bdd8287d2cfcec834c1de30713617d3 Mon Sep 17 00:00:00 2001 From: PhilippPlank <32519998+PhilippPlank@users.noreply.github.com> Date: Tue, 16 May 2023 17:40:34 +0200 Subject: [PATCH] Update models.py --- src/lava/proc/sparse/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lava/proc/sparse/models.py b/src/lava/proc/sparse/models.py index 9ae3b0050..75bd43206 100644 --- a/src/lava/proc/sparse/models.py +++ b/src/lava/proc/sparse/models.py @@ -245,6 +245,9 @@ def get_delay_wgts_mat(weights, delays) -> spmatrix: weights. """ # Can only start at 1, as delays==0 raises inefficiency warning + if np.max(delays) == 0: + return weights + weight_delay_from_1 = vstack([weights.multiply(delays == k) for k in range(1, np.max(delays) + 1)]) # Create weight matrix at delays == 0