MCPcopy Create free account
hub / github.com/dask/dask / check_for_nonfusible_fancy_indexing

Function check_for_nonfusible_fancy_indexing

dask/array/optimization.py:206–219  ·  view source on GitHub ↗
(fancy, normal)

Source from the content-addressed store, hash-verified

204
205
206def 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
222def fuse_slice(a, b):

Callers 1

fuse_sliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected