Skip to content

Commit 0ddb0cd

Browse files
committed
Less filtering in positive_definitive_matrices
1 parent 268682d commit 0ddb0cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

array_api_tests/hypothesis_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,9 @@ def positive_definite_matrices(draw, dtypes=xps.floating_dtypes()):
302302
# TODO: Generate arbitrary positive definite matrices, for instance, by
303303
# using something like
304304
# https://github.com/scikit-learn/scikit-learn/blob/844b4be24/sklearn/datasets/_samples_generator.py#L1351.
305-
n = draw(integers(0))
306-
shape = draw(shapes()) + (n, n)
305+
base_shape = draw(shapes())
306+
n = draw(integers(0, 8)) # 8 is an arbitrary small but interesting-enough value
307+
shape = base_shape + (n, n)
307308
assume(prod(i for i in shape if i) < MAX_ARRAY_SIZE)
308309
dtype = draw(dtypes)
309310
return broadcast_to(eye(n, dtype=dtype), shape)

0 commit comments

Comments
 (0)