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

Function PyArray_IntTupleFromIntp

numpy/core/src/multiarray/conversion_utils.c:1331–1352  ·  view source on GitHub ↗

Lifted from numarray */ TODO: not documented */ NUMPY_API PyArray_IntTupleFromIntp */

Source from the content-addressed store, hash-verified

1329 PyArray_IntTupleFromIntp
1330*/
1331NPY_NO_EXPORT PyObject *
1332PyArray_IntTupleFromIntp(int len, npy_intp const *vals)
1333{
1334 int i;
1335 PyObject *intTuple = PyTuple_New(len);
1336
1337 if (!intTuple) {
1338 goto fail;
1339 }
1340 for (i = 0; i < len; i++) {
1341 PyObject *o = PyArray_PyIntFromIntp(vals[i]);
1342 if (!o) {
1343 Py_DECREF(intTuple);
1344 intTuple = NULL;
1345 goto fail;
1346 }
1347 PyTuple_SET_ITEM(intTuple, i, o);
1348 }
1349
1350 fail:
1351 return intTuple;
1352}

Callers 10

array_shape_getFunction · 0.85
array_strides_getFunction · 0.85
raise_memory_errorFunction · 0.85
npyiter_shape_getFunction · 0.85
npyiter_multi_index_getFunction · 0.85
iter_coords_getFunction · 0.85
arraymultiter_shape_getFunction · 0.85

Calls 1

PyArray_PyIntFromIntpFunction · 0.85

Tested by

no test coverage detected