Consider the following code snippet where I am trying to create a dask array with asymmetric but repeated blocks of size (3, 4, 5):
import numpy as np
import dask.array as da
a = np.random.randint(0, 9, (3, 12, 10))
d = da.from_array(a, chunks=(3, 4, 5))
The above snippet does not throw any error / warning. But When I try to do the following:
r = d.map_blocks(np.sum)
out = r.compute()
It throws the error below:
python3.7/site-packages/dask/array/core.py in <listcomp>(.0)
4099
4100 while isinstance(arrays, (list, tuple)):
-> 4101 result.append(tuple([shape(deepfirst(a))[dim] for a in arrays]))
4102 arrays = arrays[0]
4103 dim += 1
IndexError: tuple index out of range
What am I doing wrong?