Skip to content

ENH: test @ and @= operators in matmul tests - #466

Open
haroune-dev wants to merge 1 commit into
data-apis:masterfrom
haroune-dev:test-matmul-operators
Open

ENH: test @ and @= operators in matmul tests#466
haroune-dev wants to merge 1 commit into
data-apis:masterfrom
haroune-dev:test-matmul-operators

Conversation

@haroune-dev

Copy link
Copy Markdown

Closes #465.

_test_matmul only tested matmul() directly, so neither @ nor @= was exercised (a broken __imatmul__ passed silently).

This resolves the # TODO: Make this also test the @ operator and adds @= coverage:

  • Out-of-place (@): Error handling for bad shapes, plus output values/dtypes checked against matmul().
  • In-place (@=): Checked only where the result fits x1 (same shape and dtype) — in-place keeps x1's dtype while matmul() promotes, and some libs rebind instead of mutating, so values-only check.

Tested with ARRAY_API_TESTS_MODULE=numpy (full test_linalg.py passes) and verified it fails as expected on a broken __imatmul__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No coverage for __imatmul__ (@=)

1 participant