[Array API] Add linalg.diagonal#70599
Conversation
This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes #62813 [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slowFor more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit d477620 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
❄️ 1 failure tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes #62813 ghstack-source-id: d6d71a2 Pull Request resolved: #70599
| supports_fwgrad_bwgrad=True, | ||
| sample_inputs_func=sample_inputs_diagonal_diag_embed), | ||
| OpInfo('diagonal', | ||
| # They are not strictly aliases, but we can see them as aliases for testing purposes |
There was a problem hiding this comment.
How are they not "strictly" aliases?
There was a problem hiding this comment.
Becuase this one has -2, -1 as the default dims (good) while torch.diagonal has 0, 1 as default dims (ugh).
|
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@lezcano Internal systems can't rebase this manually - it just needs a rebase and then please ping me to merge it. |
This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes #62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Differential Revision: [D33760506](https://our.internmc.facebook.com/intern/diff/D33760506) [ghstack-poisoned]
This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes #62813 ghstack-source-id: 5368849 Pull Request resolved: #70599
|
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes #62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854
Summary: Pull Request resolved: pytorch/pytorch#70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes pytorch/pytorch#62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854 (cherry picked from commit 44f41f8)
Summary: Pull Request resolved: pytorch/pytorch#70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes pytorch/pytorch#62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854 (cherry picked from commit 44f41f8)
Summary: Pull Request resolved: pytorch/pytorch#70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes pytorch/pytorch#62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854 (cherry picked from commit 44f41f8)
Summary: Pull Request resolved: pytorch/pytorch#70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes pytorch/pytorch#62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854 (cherry picked from commit 44f41f8)
Summary: Pull Request resolved: pytorch#70599 This PR adds `linalg.diagonal` following the Array API: https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0 Fixes pytorch#62813 cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D33760506 Pulled By: mruberry fbshipit-source-id: e32c3490321d8c3f31b3bb538bc1f72b39bd2854 (cherry picked from commit 44f41f8)
Stack from ghstack:
This PR adds
linalg.diagonalfollowing the Array API:https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html#linalg-diagonal-x-axis1-0-axis2-1-offset-0
Fixes #62813
cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @lezcano @rgommers @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi
Differential Revision: D33760506