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

Function PyArray_GenericReduceFunction

numpy/core/src/multiarray/number.c:229–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229NPY_NO_EXPORT PyObject *
230PyArray_GenericReduceFunction(PyArrayObject *m1, PyObject *op, int axis,
231 int rtype, PyArrayObject *out)
232{
233 PyObject *args, *ret = NULL, *meth;
234 PyObject *kwds;
235
236 args = Py_BuildValue("(Oi)", m1, axis);
237 kwds = _get_keywords(rtype, out);
238 meth = PyObject_GetAttrString(op, "reduce");
239 if (meth && PyCallable_Check(meth)) {
240 ret = PyObject_Call(meth, args, kwds);
241 }
242 Py_DECREF(args);
243 Py_DECREF(meth);
244 Py_XDECREF(kwds);
245 return ret;
246}
247
248
249NPY_NO_EXPORT PyObject *

Callers 10

_void_compareFunction · 0.85
PyArray_MaxFunction · 0.85
PyArray_MinFunction · 0.85
__New_PyArray_StdFunction · 0.85
PyArray_SumFunction · 0.85
PyArray_ProdFunction · 0.85
PyArray_MeanFunction · 0.85
PyArray_AnyFunction · 0.85
PyArray_AllFunction · 0.85
PyArray_TraceFunction · 0.85

Calls 1

_get_keywordsFunction · 0.85

Tested by

no test coverage detected