Implements statistical functions mean, std, var#1465
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/1465/index.html |
|
Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_5 ran successfully. |
|
Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_6 ran successfully. |
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
Other than the suggestion, this looks great @ndgrigorian ! Thank you for working on implementing these functions.
116be9f to
19ffc5f
Compare
|
Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_17 ran successfully. |
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
Thank you @ndgrigorian
Tree reductions now populate destination with the identity when reducing over zero-size axes. As a result, logic was removed for handling zero-size axes. ``argmax``, ``argmin``, ``max``, and ``min`` still raise an error for zero-size axes. Reductions now return a copy when provided an empty axis tuple. Adds additional supported dtype combinations to ``prod`` and ``sum``, specifically for input integers and inexact output type
Permits `float` accumulation type with 64 bit integer and unsigned integer inouts to prevent unnecessary copies on devices that don't support double precision
Mean in-place division now uses the real type for the denominator
19ffc5f to
9253931
Compare
|
Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_18 ran successfully. |
This pull request
Implements
dpctl.tensor.mean,dpctl.tensor.std, anddpctl.tensor.varas top-level functions which leverage tensor submodules.Resolves dpctl does not return a zero-length array when no reduction is going to be done #1456 by adding logic to tree reduction implementations that populate the output array with the identity when reducing over axes which include a zero-size axis and by adding early exits for
py_reduction_over_axis,py_tree_reduction_over_axis, andpy_search_over_axiswhen the destination array is of zero size.This permitted removing
identityas an argument to the general reduction Python API, as well as removing logic for zero-size array inputs.Adjusts reduction Python API functions to return a copy of the input array, rather than the input array itself, when no reduction will be performed (i.e.,
axis=())Adds additional supported type combinations to
sumandprodreductions. Prior to Implementsdpctl.tensor.logsumexpanddpctl.tensor.reduce_hypot#1446 , reductions overintinputs withfloatoutputs had dedicated kernels when using atomics to avoid a copy. This pull request adds these type combinations for tree reductions.