From da498b5f058aa8a8782fc49298df36609489fde8 Mon Sep 17 00:00:00 2001 From: He Sichao <1310722434@qq.com> Date: Sat, 3 Aug 2024 13:28:30 +0800 Subject: [PATCH] Update random.py --- brainpy/_src/math/random.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/brainpy/_src/math/random.py b/brainpy/_src/math/random.py index 74190cb2..3f3a8446 100644 --- a/brainpy/_src/math/random.py +++ b/brainpy/_src/math/random.py @@ -67,10 +67,9 @@ def _size2shape(size): def _check_shape(name, shape, *param_shapes): - shape = core.as_named_shape(shape) if param_shapes: - shape_ = lax.broadcast_shapes(shape.positional, *param_shapes) - if shape.positional != shape_: + shape_ = lax.broadcast_shapes(shape, *param_shapes) + if shape != shape_: msg = ("{} parameter shapes must be broadcast-compatible with shape " "argument, and the result of broadcasting the shapes must equal " "the shape argument, but got result {} for shape argument {}.")