-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More improvements to test_linalg #101
Merged
Merged
Changes from 11 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
360df9f
Add shape testing for vector_norm()
asmeurer e34f492
Test the dtype and stacks in the vector_norm() test
asmeurer 111c237
Remove an ununsed variable
asmeurer 4f3aa54
Use a simpler strategy for ord in test_vector_norm
asmeurer 979b81b
Skip the test_vector_norm test on the NumPy CI
asmeurer 8df237a
Fix syntax error
asmeurer d11a685
Fix the input strategies for test_tensordot()
asmeurer a776cd4
Add a test for the tensordot result shape
asmeurer 45b36d6
Test stacking for tensordot
asmeurer 414b322
Add allclose() and assert_allclose() helper functions
asmeurer 9bb8c7a
Use assert_allclose() in the linalg tests for float inputs
asmeurer b3fb4ec
Remove skip from test_eigh
asmeurer 241220e
Disable eigenvectors stack test
asmeurer ca70fbe
Reduce the relative tolerance in assert_allclose
asmeurer 720b309
Sort the eigenvalues when testing stacks
asmeurer 17d93bf
Merge branch 'more-linalg2' of github.com:asmeurer/array-api-tests in…
asmeurer f439259
Sort the results in eigvalsh before comparing
asmeurer 75ca73a
Remove the allclose testing in linalg
asmeurer d86a0a1
Add (commented out) stacking tests for solve()
asmeurer 9bccfa5
Remove unused none standin in the linalg tests
asmeurer f494b45
Don't compare float elements in test_tensordot
asmeurer 74add08
Fix test_vecdot
asmeurer f12be47
Fix typo in test_vecdot
asmeurer d41d0bd
Expand vecdot tests
asmeurer 1220d6e
Merge branch 'master' into more-linalg2
asmeurer a96a5df
Merge branch 'master' into more-linalg2
asmeurer 48a8442
Check specially that the result of linalg functions is not a unnamed …
asmeurer fd6367f
Use a more robust fallback helper for matrix_transpose
asmeurer 7017797
Be more constrained about constructing symmetric matrices
asmeurer 335574e
Merge branch 'more-linalg2' of github.com:asmeurer/array-api-tests in…
asmeurer 246e38a
Don't require the arguments to assert_keepdimable_shape to be positio…
asmeurer 02542ff
Show the arrays in the error message for assert_exactly_equal
asmeurer 72974e0
Allow passing an extra assertion message to assert_equal in linalg an…
asmeurer 1daba5d
Fix the true_value check for test_vecdot
asmeurer bbfe50f
Fix the test_diagonal true value check
asmeurer 64b0342
Use a function instead of operation
asmeurer 9cb58a1
Add a comment
asmeurer 0b3e170
Merge branch 'master' into more-linalg2
asmeurer c51216b
Remove flaky skips from linalg tests
asmeurer cffd076
Fix some issues in linalg tests from recent merge
asmeurer 3501116
Fix vector_norm to not use our custom arrays strategy
asmeurer 5c1aa45
Update _test_stacks to use updated ndindex behavior
asmeurer 7a46e6b
Further limit the size of n in test_matrix_power
asmeurer 6d154f2
Fix test_trace
asmeurer 257aa13
Fix test_vecdot to only generate axis in [-min(x1.ndim, x2.ndim), -1]
asmeurer afc8a25
Update test_cross to test broadcastable shapes
asmeurer 3cb9912
Fix test_cross to use assert_dtype and assert_shape helpers
asmeurer 012ca19
Remove some completed TODO comments
asmeurer 5ceb81d
Update linalg tests to test complex dtypes
asmeurer a4d419f
Update linalg tests to use assert_dtype and assert_shape helpers
asmeurer 6f9db94
Factor out dtype logic from test_sum() and test_prod() and apply it t…
asmeurer 5aa9083
Remove unused allclose and assert_allclose helpers
asmeurer 938f086
Update ndindex version requirement
asmeurer 3856b8f
Fix linting issue
asmeurer ccc6ca3
Skip `test_cross` in CI
honno 3092422
Test matmul, matrix_transpose, tensordot, and vecdot for the main and…
asmeurer 2d918e4
Merge branch 'more-linalg2' of github.com:asmeurer/array-api-tests in…
asmeurer 3fefd20
Remove need for filtering in `invertible_matrices()`
honno a76e051
Merge branch 'master' into more-linalg2
honno 268682d
Skip flaky `test_reshape`
honno 0ddb0cd
Less filtering in `positive_definitive_matrices`
honno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep looks good, this is really how we have to do it if we can't use masking.
Maybe move this and
assert_allclose
totest_linalg.py
for now, as ideally what we'd be doing is standardising these utils across function groups then, and scoping these utils for each function group makes it easier to distinguish where they're used and their subtle differences. (standardising seems quite doable, I just need to get round to it)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem here is represents a pretty significant performance hit. Before this commit (with the exact equality test), the linalg tests take 15 seconds on my computer. After, they take 44 seconds. Performance isn't our top priority, but maybe we should try array operations and only fallback to this when there are nonfinite values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I'd still like this for now, esp as I'm generally rethinking the pytest helpers for #200/general look at vectorisation. Not blocking tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm just going to delete them. I'm not using them anymore, because testing float arrays from linalg functions like this turned out to be too difficult.