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

Function _check_axis_support

numpy/core/src/umath/ufunc_object.c:1758–1771  ·  view source on GitHub ↗

* Check whether the gufunc can be used with axis, i.e., that there is only * a single, shared core dimension (which means that operands either have * that dimension, or have no core dimensions). Returns 0 if all is fine, * and sets an error and returns -1 if not. */

Source from the content-addressed store, hash-verified

1756 * and sets an error and returns -1 if not.
1757 */
1758static int
1759_check_axis_support(PyUFuncObject *ufunc) {
1760 if (ufunc->core_num_dim_ix != 1) {
1761 PyErr_Format(PyExc_TypeError,
1762 "%s: axis can only be used with a single shared core "
1763 "dimension, not with the %d distinct ones implied by "
1764 "signature %s.",
1765 ufunc_get_name_cstr(ufunc),
1766 ufunc->core_num_dim_ix,
1767 ufunc->core_signature);
1768 return -1;
1769 }
1770 return 0;
1771}
1772
1773/*
1774 * Check whether the gufunc can be used with keepdims, i.e., that all its

Callers 1

Calls 1

ufunc_get_name_cstrFunction · 0.85

Tested by

no test coverage detected