Skip to content

Commit 695c67e

Browse files
committed
Final shape not exceed max size in hh.invertible_matrices()
1 parent 762f1e7 commit 695c67e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array_api_tests/hypothesis_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ def positive_definite_matrices(draw, dtypes=xps.floating_dtypes()):
312312
@composite
313313
def invertible_matrices(draw, dtypes=xps.floating_dtypes(), stack_shapes=shapes()):
314314
# For now, just generate stacks of diagonal matrices.
315-
n = draw(integers(0, SQRT_MAX_ARRAY_SIZE),)
316315
stack_shape = draw(stack_shapes)
316+
n = draw(integers(0, SQRT_MAX_ARRAY_SIZE // max(math.prod(stack_shape), 1)),)
317317
dtype = draw(dtypes)
318318
elements = one_of(
319319
from_dtype(dtype, min_value=0.5, allow_nan=False, allow_infinity=False),

0 commit comments

Comments
 (0)