issues
search
data-apis
/
array-api
RFC document, tooling and other content related to the array API standard
https://data-apis.github.io/array-api/latest/
MIT License
204
stars
42
forks
source link
feat: add `count_nonzero` to specification
#803
Open
kgryte
opened
2 months ago
kgryte
commented
2 months ago
This PR
resolves
https://github.com/data-apis/array-api/issues/794
by adding support for counting the number of non-zero values to the specification.
is consistent with statistical functions (such as
max
,
mean
,
sum
, etc) in supporting one or more axes over which to perform the reduction and in supporting
keepdims
to ensure the returned result is broadcast compatible.
follows
nonzeros
(ref:
https://github.com/data-apis/array-api/pull/23#issuecomment-680784657
) in disallowing zero-dimensional input arrays. Note, however, that the statistical function APIs do not contain any explicit guidance regarding minimum rank.
updates
nonzeros
by moving the notes to a dedicated notes section (i.e., below the "fold").
This PR
max
,mean
,sum
, etc) in supporting one or more axes over which to perform the reduction and in supportingkeepdims
to ensure the returned result is broadcast compatible.nonzeros
(ref: https://github.com/data-apis/array-api/pull/23#issuecomment-680784657) in disallowing zero-dimensional input arrays. Note, however, that the statistical function APIs do not contain any explicit guidance regarding minimum rank.nonzeros
by moving the notes to a dedicated notes section (i.e., below the "fold").