| 204 | |
| 205 | |
| 206 | def check_for_nonfusible_fancy_indexing(fancy, normal): |
| 207 | # Check for fancy indexing and normal indexing, where the fancy |
| 208 | # indexed dimensions != normal indexed dimensions with integers. E.g.: |
| 209 | # disallow things like: |
| 210 | # x[:, [1, 2], :][0, :, :] -> x[0, [1, 2], :] or |
| 211 | # x[0, :, :][:, [1, 2], :] -> x[0, [1, 2], :] |
| 212 | for f, n in zip_longest(fancy, normal, fillvalue=slice(None)): |
| 213 | if type(f) is not list and isinstance(n, Integral): |
| 214 | raise NotImplementedError( |
| 215 | "Can't handle normal indexing with " |
| 216 | "integers and fancy indexing if the " |
| 217 | "integers and fancy indices don't " |
| 218 | "align with the same dimensions." |
| 219 | ) |
| 220 | |
| 221 | |
| 222 | def fuse_slice(a, b): |