Skip to content

Commit

Permalink
fix autograd bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Sep 18, 2024
1 parent 0a1fa85 commit a45583b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions brainpy/_src/math/object_transform/autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ def __call__(self, *args, **kwargs):
*args,
**kwargs)
cache_stack(self.target, stack)

self._dyn_vars = stack
self._dyn_vars.remove_by_id(*[id(v) for v in self._grad_vars])
self._dyn_vars = stack
self._dyn_vars.remove_by_id(*[id(v) for v in self._grad_vars])

# if not the outermost transformation
if not stack.is_first_stack():
Expand Down

0 comments on commit a45583b

Please sign in to comment.