Skip to content

Commit

Permalink
Update random.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck committed Aug 3, 2024
1 parent 21068ff commit da498b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions brainpy/_src/math/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}.")
Expand Down

0 comments on commit da498b5

Please sign in to comment.