Skip to content

Add specification for computing the matrix product (linalg: matmul) #134

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

Merged
merged 10 commits into from
May 12, 2021

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Mar 1, 2021

This PR

  • specifies the interface for computing the matrix product.
  • is derived from comparing signatures across array libraries.

Notes

  • NumPy supports gufunc keyword arguments: out, casting, dtype, subok, order, etc.

  • NumPy, CuPy, Torch, MXNet support providing an output array.

  • JAX supports specifying a precision keyword argument.

  • TF supports various keywords for transposing array arguments (transpose_a, transpose_b), conjugating array arguments (adjoint_a, adjoint_b), and indicating whether an array argument is sparse (a_is_sparse, b_is_sparse). TF is alone in supporting these arguments.

  • This PR follows PEP 465 and the semantics of the built-in @ operator.

@asmeurer
Copy link
Member

asmeurer commented Mar 1, 2021

Should we require that 0-dimensional arrays give an error? Note that the PEP says they should.

@kgryte
Copy link
Contributor Author

kgryte commented Mar 4, 2021

@asmeurer Thanks for the suggestion. I have documented the exceptions in accordance with the PEP (0d) and NumPy (nd).

@rgommers rgommers added the API extension Adds new functions or objects to the API. label Mar 20, 2021
@kgryte
Copy link
Contributor Author

kgryte commented Apr 12, 2021

Latest merge resolves build failures. CI is now passing.

@rgommers rgommers force-pushed the main branch 3 times, most recently from 0607525 to 138e963 Compare April 19, 2021 20:25
@kgryte
Copy link
Contributor Author

kgryte commented May 12, 2021

This PR has been open for some time without comment and has been discussed/approved during meetings. Will merge, and we can submit follow-up PRs should any issues/concerns arise.

@kgryte kgryte merged commit 7557e69 into main May 12, 2021
@kgryte kgryte deleted the matmul branch May 12, 2021 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API extension Adds new functions or objects to the API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants