| 227 | } |
| 228 | |
| 229 | NPY_NO_EXPORT PyObject * |
| 230 | PyArray_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 | |
| 249 | NPY_NO_EXPORT PyObject * |
no test coverage detected