8000 strides comparison performance fix, compare discussion #29179 · numpy/numpy@c6f1c58 · GitHub
[go: up one dir, main page]

Skip to content

Commit c6f1c58

Browse files
committed
strides comparison performance fix, compare discussion #29179
1 parent 303095e commit c6f1c58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/_core/src/umath/matmul.c.src

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ NPY_NO_EXPORT void
554554
} else {
555555
/* matrix @ matrix
556556
* copy if not blasable, see gh-12365 & gh-23588 */
557-
npy_bool i1_transpose = is1_m < is1_n,
558-
i2_transpose = is2_n < is2_p,
559-
o_transpose = os_m < os_p;
557+
npy_bool i1_transpose = labs(is1_m) < labs(is1_n),
558+
i2_transpose = labs(is2_n) < labs(is2_p),
559+
o_transpose = labs(os_m) < labs(os_p);
560560

561561
npy_intp tmp_is1_m = i1_transpose ? sz : sz*dn,
562562
tmp_is1_n = i1_transpose ? sz*dm : sz,

0 commit comments

Comments
 (0)
0