Skip to content

Commit

Permalink
fix delay update bug (#281
Browse files Browse the repository at this point in the history
fix delay update bug
  • Loading branch information
chaoming0625 authored Oct 18, 2022
2 parents 87c0b86 + 7a3219a commit daf5002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brainpy/math/delayvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ def update(self, value: Union[float, int, bool, JaxArray, jnp.DeviceArray]):
The value of the latest data, used to update this delay variable.
"""
if self.update_method == ROTATION_UPDATING:
self.idx.value = stop_gradient((self.idx - 1) % self.num_delay_step)
self.data[self.idx[0]] = value
self.idx.value = stop_gradient((self.idx + 1) % self.num_delay_step)

elif self.update_method == CONCAT_UPDATING:
if self.num_delay_step >= 2:
Expand Down

0 comments on commit daf5002

Please sign in to comment.