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 a45583b commit 10043a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions brainpy/_src/math/object_transform/autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def __call__(self, *args, **kwargs):
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():
return self._return(rets)
# if not the outermost transformation
if not stack.is_first_stack():
return self._return(rets)

rets = self._transform(
[v.value for v in self._grad_vars], # variables for gradients
Expand Down

0 comments on commit 10043a0

Please sign in to comment.