Skip to content
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

any plan to add power function like numpy? #162

Open
kylooh opened this issue May 11, 2023 · 5 comments
Open

any plan to add power function like numpy? #162

kylooh opened this issue May 11, 2023 · 5 comments
Labels
api Common api enhancement New feature or request jvm An issue/PR related to JVM native An issue/PR related to Native
Milestone

Comments

@kylooh
Copy link

kylooh commented May 11, 2023

I'd like to hava a power function just like numpy.

Behavoirs:

case 1:

array [1, 2, 3, 4, 5] power number 2 returns [1, 4, 9, 16, 25]

case 2:

array [1, 2, 3, 4, 5] power array [1, 1, 2, 2, 1] returns [1, 2, 9, 16, 5]

case 3:

array [1, 2, 3, 4, 5] power array of [[1, 1, 2, 2, 1], [2, 2, 1, 1, 2]] returns [[1, 2, 9, 16, 5], [1, 4, 3, 4, 25]]

Guys, do you have any plan for this one? Or it is just a not such reasonable case for library design. Or there is already one simliar function with different name.

Thx.

@devcrocod
Copy link
Collaborator

There is a pow function, but it raises the entire matrix to the power. It makes sense to add the function you described to the library

@devcrocod devcrocod added feature api Common api labels May 13, 2023
@devcrocod devcrocod added this to the 0.3.0 milestone May 13, 2023
@tklinchik
Copy link

@devcrocod Where can I find matrix power feature you referenced?

@tklinchik
Copy link

Thanks. Any plans to support power to float/double besides just int? What about in-place?

@devcrocod
Copy link
Collaborator

Any plans to support power to float/double besides just int?

Yes, it is planned

What about in-place?

I'm avoiding using inplace operations for now, as it creates a lot of problems. I tried to add a new API for such operations, but I see that it is not used, so I will remove it in subsequent releases

@devcrocod devcrocod added enhancement New feature or request jvm An issue/PR related to JVM native An issue/PR related to Native and removed feature labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Common api enhancement New feature or request jvm An issue/PR related to JVM native An issue/PR related to Native
Projects
None yet
Development

No branches or pull requests

3 participants