Skip to content

Commit

Permalink
Fix _format_shape in random_inits.py (#584)
Browse files Browse the repository at this point in the history
Update random_inits.py

fix a bug in `format_shape`
  • Loading branch information
charlielam0615 committed Jan 4, 2024
1 parent 9b095b9 commit 43b933e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brainpy/_src/initialize/random_inits.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _format_shape(shape):
if len(shape) == 0:
raise ValueError('Please provide shape.')
if len(shape) == 1:
if isinstance(shape, (tuple, list)):
if isinstance(shape[0], (tuple, list)):
return shape[0]
else:
return shape
Expand Down

0 comments on commit 43b933e

Please sign in to comment.