diff --git a/brainpy/_src/initialize/random_inits.py b/brainpy/_src/initialize/random_inits.py index d7097666..fbad02dd 100644 --- a/brainpy/_src/initialize/random_inits.py +++ b/brainpy/_src/initialize/random_inits.py @@ -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