Skip to content

Commit

Permalink
Final shape not exceed max size in hh.invertible_matrices()
Browse files Browse the repository at this point in the history
  • Loading branch information
honno committed Mar 12, 2024
1 parent 762f1e7 commit 695c67e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion array_api_tests/hypothesis_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ def positive_definite_matrices(draw, dtypes=xps.floating_dtypes()):
@composite
def invertible_matrices(draw, dtypes=xps.floating_dtypes(), stack_shapes=shapes()):
# For now, just generate stacks of diagonal matrices.
n = draw(integers(0, SQRT_MAX_ARRAY_SIZE),)
stack_shape = draw(stack_shapes)
n = draw(integers(0, SQRT_MAX_ARRAY_SIZE // max(math.prod(stack_shape), 1)),)
dtype = draw(dtypes)
elements = one_of(
from_dtype(dtype, min_value=0.5, allow_nan=False, allow_infinity=False),
Expand Down

0 comments on commit 695c67e

Please sign in to comment.