10000 BUG: Use int for axes, not intp · numpy/numpy@1dacacf · GitHub
[go: up one dir, main page]

Skip to content

Commit 1dacacf

Browse files
committed
BUG: Use int for axes, not intp
Rationale: typeof(PyArray_Dims.len) is int, so typeof(axis) should be the same.
1 parent 2aabeaf commit 1dacacf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpy/core/src/multiarray/shape.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,9 @@ PyArray_SwapAxes(PyArrayObject *ap, int a1, int a2)
680680
NPY_NO_EXPORT PyObject *
681681
PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute)
682682
{
683-
npy_intp *axes, axis;
684-
npy_intp i, n;
685-
npy_intp permutation[NPY_MAXDIMS], reverse_permutation[NPY_MAXDIMS];
683+
npy_intp *axes;
684+
int i, n;
685+
int permutation[NPY_MAXDIMS], reverse_permutation[NPY_MAXDIMS];
686686
PyArrayObject *ret = NULL;
687687
int flags;
688688

@@ -704,7 +704,7 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute)
704704
reverse_permutation[i] = -1;
705705
}
706706
for (i = 0; i < n; i++) {
707-
axis = axes[i];
707+
int axis = axes[i];
708708
if (check_and_adjust_axis(&axis, PyArray_NDIM(ap)) < 0) {
709709
return NULL;
710710
}

0 commit comments

Comments
 (0)
0