-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add mean
keyword to dpnp.std
and dpnp.var
#2271
Conversation
Array API standard conformance tests for dpnp=0.17.0dev4=py312he4f9c94_19 ran successfully. |
eb07397
to
0f463e9
Compare
View rendered docs @ https://intelpython.github.io/dpnp/pull/2271/index.html |
Disable pylint `duplicate-code` checker due to false-possitive issues reported.
Array API standard conformance tests for dpnp=0.17.0dev5=py312he4f9c94_19 ran successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @antonwolfy!
Co-authored-by: Vahid Tavanashad <[email protected]>
The PR proposes to add `mean` keyword argument to `dpnp.std`, `dpnp.var`, `dpnp.nanstd`, `dpnp.nanvar` functions and `dpnp.ndarray.std`, `dpnp.ndarray.var` methods. The keyword was introduced by NumPy 2.0 and intended to improve the performance: > Often when the standard deviation is needed the mean is also needed; the same holds for the variance and the mean. With the current code the mean is then calculated twice, this can be prevented if the functions calculating the variance or the standard deviation can use a precalculated mean This PR implements similar improvement in dpnp code. b72f953
The PR proposes to add
mean
keyword argument todpnp.std
,dpnp.var
,dpnp.nanstd
,dpnp.nanvar
functions anddpnp.ndarray.std
,dpnp.ndarray.var
methods.The keyword was introduced by NumPy 2.0 and intended to improve the performance:
This PR implements similar improvement in dpnp code.