Repository navigation
Commit e45f588
committed
BUG: keep dot's own 0-D path for DTypes without a dotfunc
`dot` has always handled a 0-D operand with `multiply`, for every dtype,
after casting both operands to their common dtype. Diverting DTypes
without a dotfunc into the fallback skipped that cast, which exposed
`multiply`'s heterogeneous loops where `dot` never allowed them:
np.dot(np.array('ab'), 3, out=np.empty((), 'U6'))
returned 'ababab' instead of raising, and the same for bytes. Move the
dotfunc check below the existing 0-D block so those operands stay on
dot's own code path, and let the fallback handle only the matmul case.
Checked against a build with the fallback compiled out over 8752
dot/vdot/inner cases (dtype x shape grids, mixed dtypes, out=,
subclasses, Fortran and strided layouts, empty arrays): no case where
one succeeds and the other raises, and no differing results.1 parent 82e3bf3 commit e45f588
3 files changed
Lines changed: 56 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1235 | 1235 | | |
1236 | 1236 | | |
1237 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1238 | 1241 | | |
1239 | 1242 | | |
1240 | 1243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | 1017 | | |
1030 | 1018 | | |
1031 | 1019 | | |
| |||
1057 | 1045 | | |
1058 | 1046 | | |
1059 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1060 | 1071 | | |
1061 | 1072 | | |
1062 | 1073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
8829 | 8830 | | |
8830 | 8831 | | |
8831 | 8832 | | |
| 8833 | + | |
| 8834 | + | |
| 8835 | + | |
| 8836 | + | |
| 8837 | + | |
| 8838 | + | |
| 8839 | + | |
| 8840 | + | |
| 8841 | + | |
| 8842 | + | |
| 8843 | + | |
| 8844 | + | |
| 8845 | + | |
| 8846 | + | |
| 8847 | + | |
| 8848 | + | |
| 8849 | + | |
| 8850 | + | |
| 8851 | + | |
| 8852 | + | |
| 8853 | + | |
| 8854 | + | |
| 8855 | + | |
| 8856 | + | |
| 8857 | + | |
| 8858 | + | |
| 8859 | + | |
| 8860 | + | |
| 8861 | + | |
8832 | 8862 | | |
8833 | 8863 | | |
8834 | 8864 | | |
| |||
0 commit comments