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

Function new_array_op

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

Helper for ufunc_at, below */

Source from the content-addressed store, hash-verified

5916
5917/* Helper for ufunc_at, below */
5918static inline PyArrayObject *
5919new_array_op(PyArrayObject *op_array, char *data)
5920{
5921 npy_intp dims[1] = {1};
5922 Py_INCREF(PyArray_DESCR(op_array)); /* NewFromDescr steals a reference */
5923 PyObject *r = PyArray_NewFromDescr(&PyArray_Type, PyArray_DESCR(op_array),
5924 1, dims, NULL, data,
5925 NPY_ARRAY_WRITEABLE, NULL);
5926 return (PyArrayObject *)r;
5927}
5928
5929/*
5930 * Use an indexed loop to do the work

Callers 1

ufunc_at__slow_iterFunction · 0.85

Calls 2

PyArray_DESCRFunction · 0.85
PyArray_NewFromDescrFunction · 0.85

Tested by

no test coverage detected