Skip to content

Commit

Permalink
Minor refactoring for DelayDense/Sparse process (#693)
Browse files Browse the repository at this point in the history
* Update process.py

* Update process.py

* Update process.py

* Update process.py
  • Loading branch information
PhilippPlank authored May 16, 2023
1 parent 8576c19 commit e39a4b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/lava/proc/dense/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,18 @@ def __init__(self,
spikes as binary spikes (num_message_bits = 0) or as graded
spikes (num_message_bits > 0). Default is 0.
"""
if max_delay == 0:
max_delay = int(np.max(delays))

super().__init__(weights=weights,
num_message_bits=num_message_bits,
name=name,
log_config=log_config,
max_delay=max_delay,
**kwargs)

self._validate_delays(weights, delays)
shape = weights.shape
if max_delay == 0:
max_delay = int(np.max(delays))

# Variables
self.delays = Var(shape=shape, init=delays)
Expand Down
5 changes: 3 additions & 2 deletions src/lava/proc/sparse/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,18 @@ def __init__(self,
spikes as binary spikes (num_message_bits = 0) or as graded
spikes (num_message_bits > 0). Default is 0.
"""
if max_delay == 0:
max_delay = int(np.max(delays))

super().__init__(weights=weights,
num_message_bits=num_message_bits,
name=name,
log_config=log_config,
max_delay=max_delay,
**kwargs)

self._validate_delays(weights, delays)
shape = weights.shape
if max_delay == 0:
max_delay = int(np.max(delays))

# Variables
self.delays = Var(shape=shape, init=delays)
Expand Down

0 comments on commit e39a4b6

Please sign in to comment.