Skip to content

Split linalg.norm into separate vector and matrix APIs #236

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 1 commit into from
Aug 23, 2021
Merged

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Jul 26, 2021

This PR

  • resolves gh-213 by splitting the linalg.norm API into separate matrix and vector APIs for computing matrix and vector norms, respectively.

Notes

  • For linalg.vector_norm, the default axis is None, in order to maintain NumPy compatibility (i.e., the default behavior is to compute the norm over all array values). Torch also does this at the time of this PR.
  • For linalg.vector_norm, axis is allowed to be an n-tuple along which to compute batched vector norms.

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Linear Algebra Linear algebra. labels Jul 26, 2021
@kgryte
Copy link
Contributor Author

kgryte commented Aug 23, 2021

This PR was discussed and encountered no objections during the consortium meeting held on 2021-07-29. If further revisions are necessary, they can be addressed in follow-up PRs based on array library implementation feedback.

@kgryte kgryte merged commit a7a91fe into main Aug 23, 2021
@kgryte kgryte deleted the remove-norm branch August 23, 2021 18:18
@arogozhnikov
Copy link

Hi @kgryte I see this PR merged a while ago, and I can find function via search in array api website, but I don't see either of norms mentioned here:
https://data-apis.org/array-api/latest/API_specification/linear_algebra_functions.html

@lucascolley
Copy link
Member

Hi @arogozhnikov , these functions are part of the Linear Algebra extension module, which you can find at https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html.

Your link goes to the few linear algebra functions which are deemed fundamental enough to be required in the main namespace (see more about extensions at https://data-apis.org/array-api/latest/extensions/index.html).

@arogozhnikov
Copy link

thanks @lucascolley, now I get the difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Linear Algebra Linear algebra.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: split linalg.norm into dedicated matrix and vector APIs
3 participants