8000 Add specifications for returning upper (`triu`) and lower (`tril`) triangular matrices by kgryte · Pull Request #243 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add specifications for returning upper (triu) and lower (tril) triangular matrices #243

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 4 commits into from
Sep 20, 2021
Merged
Changes from 1 commit
Commits
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
Add note about allocation
  • Loading branch information
kgryte committed Sep 13, 2021
commit 51d38f4963ccdc47193d5778774f379564154388
4 changes: 2 additions & 2 deletions spec/API_specification/creation_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ The lower triangular part of the matrix is defined as the elements on and below

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

- an array containing the lower triangular part(s). The returned array must have the same shape and data type as `x`. All elements above the specified diagonal `k` must be zeroed.
- an array containing the lower triangular part(s). The returned array must have the same shape and data type as `x`. All elements above the specified diagonal `k` must be zeroed. The returned array should be allocated on the same device as `x`.

(function-triu)=
### triu(x, /, *, k=0)
Expand Down Expand Up @@ -424,7 +424,7 @@ The upper triangular part of the matrix is defined as the elements on and above

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

- an array containing the upper triangular part(s). The returned array must have the same shape and data type as `x`. All elements below the specified diagonal `k` must be zeroed.
- an array containing the upper triangular part(s). The returned array must have the same shape and data type as `x`. All elements below the specified diagonal `k` must be zeroed. The returned array should be allocated on the same device as `x`.

(function-zeros)=
### zeros(shape, *, dtype=None, device=None)
Expand Down
0