Split linalg.norm into separate vector and matrix APIs#236
Conversation
|
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. |
|
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: |
|
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). |
|
thanks @lucascolley, now I get the difference |
This PR
linalg.normAPI into separate matrix and vector APIs for computing matrix and vector norms, respectively.Notes
linalg.vector_norm, the defaultaxisisNone, 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.linalg.vector_norm,axisis allowed to be an n-tuple along which to compute batched vector norms.