- 
                Notifications
    
You must be signed in to change notification settings  - Fork 31
 
          Implements statistical functions mean, std, var
          #1465
        
          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
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.  | 
    
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.
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.  | 
    
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 @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.