Skip to content

Commit 237a496

Browse files
committed
fix bug
1 parent d2b2a15 commit 237a496

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

brainpy/_src/initialize/tests/test_regular_inits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_one_init(self):
2020
init = bp.init.OneInit(value=value)
2121
weights = init(size)
2222
assert weights.shape == size
23-
assert isinstance(weights, bp.math.ndarray)
2423
assert (weights == value).all()
2524

2625

brainpy/_src/math/ndarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _check_input_array(array):
9393

9494

9595
def _return(a):
96-
if _return_bp_array and isinstance(a, jax.Array) and a.ndim > 1:
96+
if _return_bp_array and isinstance(a, jax.Array) and a.ndim > 0:
9797
return Array(a)
9898
return a
9999

0 commit comments

Comments
 (0)