Count non-zero values in an array along a given dimension. More...
Functions | |
AFAPI array | count (const array &in, const int dim=-1) |
C++ Interface to count non-zero values in an array along a given dimension. More... | |
template<typename T > | |
T | count (const array &in) |
C++ Interface to count non-zero values along the first non-singleton dimension. More... | |
AFAPI af_err | af_count (af_array *out, const af_array in, const int dim) |
C Interface to count non-zero values in an array along a given dimension. More... | |
AFAPI af_err | af_count_all (double *real, double *imag, const af_array in) |
C Interface to count non-zero values over all dimensions. More... | |
AFAPI af_err | af_count_all_array (af_array *out, const af_array in) |
C Interface to count non-zero values over all dimensions. More... | |
Count non-zero values in an array along a given dimension.
The output type is u32
.
This function runs across all batches in the input simultaneously.
C Interface to count non-zero values in an array along a given dimension.
NaN values are treated as non-zero.
[out] | out | count |
[in] | in | input array |
[in] | dim | dimension along which the count occurs |
C Interface to count non-zero values over all dimensions.
[out] | real | count |
[out] | imag | 0 |
[in] | in | input array |
C Interface to count non-zero values over all dimensions.
[out] | out | count |
[in] | in | input array |
T count | ( | const array & | in | ) |
C++ Interface to count non-zero values along the first non-singleton dimension.
NaN values are treated as non-zero.
[in] | in | input array |
C++ Interface to count non-zero values in an array along a given dimension.
NaN values are treated as non-zero.
[in] | in | input array |
[in] | dim | dimension along which the count occurs, -1 denotes the first non-singleton dimension |