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

Function npyiter_get_op_axis

numpy/core/src/multiarray/nditer_constr.c:1467–1478  ·  view source on GitHub ↗

* Removes the (additive) NPY_ITER_REDUCTION_AXIS indication and sets * is_forced_broadcast to 1 if it is set. Otherwise to 0. * * @param axis The op_axes[i] to normalize. * @param reduction_axis Output 1 if a reduction axis, otherwise 0. * @returns The normalized axis (without reduce axis flag). */

Source from the content-addressed store, hash-verified

1465 * @returns The normalized axis (without reduce axis flag).
1466 */
1467static inline int
1468npyiter_get_op_axis(int axis, npy_bool *reduction_axis) {
1469 npy_bool forced_broadcast = axis >= NPY_ITER_REDUCTION_AXIS(-1);
1470
1471 if (reduction_axis != NULL) {
1472 *reduction_axis = forced_broadcast;
1473 }
1474 if (forced_broadcast) {
1475 return axis - NPY_ITER_REDUCTION_AXIS(0);
1476 }
1477 return axis;
1478}
1479
1480/*
1481 * Fills in the AXISDATA for the 'nop' operands, broadcasting

Callers 4

npyiter_check_op_axesFunction · 0.85
npyiter_fill_axisdataFunction · 0.85
npyiter_replace_axisdataFunction · 0.85
npyiter_new_temp_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected