Skip to content

Commit 23248e6

Browse files
committed
Fix argument names in scan and while_loop wrappers
Updated the scan function to use correct argument names ('f' and 'pbar') for brainstate.transform.scan. Fixed while_loop to properly wrap cond_fun in a lambda, matching the expected signature.
1 parent 8dad989 commit 23248e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

brainpy/_src/math/object_transform/controls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ def scan(
308308
The stacked outputs of ``body_fun`` when scanned over the leading axis of the inputs.
309309
"""
310310
return brainstate.transform.scan(
311-
body_fun=body_fun,
311+
f=body_fun,
312312
init=init,
313313
xs=operands,
314314
reverse=reverse,
315315
unroll=unroll,
316-
progress_bar=brainstate.transform.ProgressBar() if progress_bar else None,
316+
pbar=brainstate.transform.ProgressBar() if progress_bar else None,
317317
)
318318

319319

@@ -381,4 +381,4 @@ def while_loop(
381381
"""
382382
if not isinstance(operands, (tuple, list)):
383383
operands = (operands,)
384-
return brainstate.transform.while_loop(lambda x: body_fun(*x), cond_fun(*x), operands)
384+
return brainstate.transform.while_loop(lambda x: body_fun(*x), lambda x: cond_fun(*x), operands)

0 commit comments

Comments
 (0)