8000 Add initial linear algebra function specifications by kgryte · Pull Request #20 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add initial linear algebra function specifications #20

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 21 commits into from
Sep 8, 2020
Merged
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update norm behavior for multi-dimensional arrays
  • Loading branch information
8000
kgryte committed Aug 24, 2020
commit 83593dcec06b2084276e93852ec0fcc40eac2d4d
14 changes: 9 additions & 5 deletions spec/API_specification/linear_algebra_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,21 @@ Computes the matrix or vector norm of `a`.

- **a**: _<array>_

- input array. If `axis` is `None`, `a` must be either one- or two-dimensional.
- input array.

- **axis**: _Optional\[ Union\[ int, Tuple\[ int, int ] ] ]_

- If an integer, `axis` specifies the axis (dimension) along which to compute vector norms. If a 2-tuple, `axis` specifies the axes (dimensions) defining two-dimensional matrices for which to compute matrix norms. If `None`,
- If an integer, `axis` specifies the axis (dimension) along which to compute vector norms.

If a 2-tuple, `axis` specifies the axes (dimensions) defining two-dimensional matrices for which to compute matrix norms.

If `None`,

- if `a` is one-dimensional, the function computes the vector norm.
- if `a` is two-dimensional, the function computes the matrix norm.
- if `a` has more than two dimensions, the function computes the vector norm for vectors defined by the last axis (dimension). Equivalent to specifying `axis=-1`.
- if `a` has more than two dimensions, the function computes the vector norm over all array values (i.e., equivalent to computing the vector norm of a flattened array).

Negative indices must be supported. Default: `None`.
Negative indices must be supported. Default: `None`.

- **keepdims**: _bool_

Expand Down Expand Up @@ -158,7 +162,7 @@ Computes the matrix or vector norm of `a`.

- **out**: _<array>_

- an array containing the norms. Must have the same data type as `a`. If `axis` is a scalar value (`int` or `float`), the output array has a rank which is one less than the rank of `a`. If `axis` is a 2-tuple, the output array has a rank which is two less than the rank of `a`.
- an array containing the norms. Must have the same data type as `a`. If `axis` is `None`, the output array is a zero-dimensional array containing a vector norm. If `axis` is a scalar value (`int` or `float`), the output array has a rank which is one less than the rank of `a`. If `axis` is a 2-tuple, the output array has a rank which is two less than the rank of `a`.

### <a name="outer" href="#outer">#</a> outer(a, b, /)

Expand Down
0