Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ENH: linalg module, mT property, and multiple outputs from @compiled #94

Merged
merged 4 commits into from
Mar 12, 2025

Conversation

mtsokol
Copy link
Member

@mtsokol mtsokol commented Mar 11, 2025

Hi @hameerabbasi,

This PR introduces improvements that my pydata/sparse use-case requires:

  • Array API compatible linalg module with the first function, vector_norm.
  • Array API mT array class property.
  • @compiled decorator accepting multiple outputs.

@mtsokol mtsokol added the enhancement New feature or request label Mar 11, 2025
@mtsokol mtsokol requested a review from hameerabbasi March 11, 2025 12:34
@mtsokol mtsokol self-assigned this Mar 11, 2025
Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested a few simplifications to the code. The overall logic of the PR LGTM.

@hameerabbasi
Copy link
Collaborator

A test for multiple-return would also be appreciated.

@mtsokol
Copy link
Member Author

mtsokol commented Mar 11, 2025

A test for multiple-return would also be appreciated.

Done!

@mtsokol mtsokol requested a review from hameerabbasi March 11, 2025 14:21
@willow-ahrens
Copy link
Collaborator

I'm surprised that @compiled didn't already accept multiple outputs! The interface you've implemented is really intuitive. Thanks Mateusz.

Copy link
Member Author

@mtsokol mtsokol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hameerabbasi Thanks for improving the nesting returns logic!
Left last comments, and maybe one last thing is a test which covers:

@compiled()
def foo_bar(a: Tensor, b: Tensor, c: int):
    c = a + b
    d = c ** 2
    return (a, c, (b, "text"), {"key1": 12, "key2": d})

@hameerabbasi
Copy link
Collaborator

The test caught some bugs! Thanks for the suggestions, @mtsokol.

@mtsokol mtsokol merged commit 9790cd7 into main Mar 12, 2025
5 checks passed
@mtsokol mtsokol deleted the ms/vector-norm branch March 12, 2025 09:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants