MCPcopy Create free account
hub / github.com/numpy/numpy / count_axes

Function count_axes

numpy/core/src/umath/reduction.c:34–46  ·  view source on GitHub ↗

* Count the number of dimensions selected in 'axis_flags' */

Source from the content-addressed store, hash-verified

32 * Count the number of dimensions selected in 'axis_flags'
33 */
34static int
35count_axes(int ndim, const npy_bool *axis_flags)
36{
37 int idim;
38 int naxes = 0;
39
40 for (idim = 0; idim < ndim; ++idim) {
41 if (axis_flags[idim]) {
42 naxes++;
43 }
44 }
45 return naxes;
46}
47
48/*
49 * This function initializes a result array for a reduction operation

Callers 1

PyUFunc_ReduceWrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected