From 43b933ef9f02d1f71794d770b7d7f576ec8edfdf Mon Sep 17 00:00:00 2001 From: charlielam0615 Date: Thu, 4 Jan 2024 16:27:51 +0800 Subject: [PATCH] Fix `_format_shape` in `random_inits.py` (#584) Update random_inits.py fix a bug in `format_shape` --- brainpy/_src/initialize/random_inits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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