diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -478,7 +478,7 @@ def apply_infer_dtype(func, args, kwargs, funcname, suggest_dtype="dtype", nout=
         msg = None
     if msg is not None:
         raise ValueError(msg)
-    return o.dtype if nout is None else tuple(e.dtype for e in o)
+    return getattr(o, "dtype", type(o)) if nout is None else tuple(e.dtype for e in o)
 
 
 def normalize_arg(x):
@@ -523,6 +523,7 @@ def map_blocks(
     chunks=None,
     drop_axis=[],
     new_axis=None,
+    enforce_ndim=False,
     meta=None,
     **kwargs,
 ):
@@ -555,6 +556,11 @@ def map_blocks(
     new_axis : number or iterable, optional
         New dimensions created by the function. Note that these are applied
         after ``drop_axis`` (if present).
+    enforce_ndim : bool, default True
+        Whether to enforce at runtime that the dimensionality of the array
+        produced by ``func`` actually matches that of the array returned by
+        ``map_blocks``.
+        This will raise an error if there is a mismatch.
     token : string, optional
         The key prefix to use for the output array. If not provided, will be
         determined from the function name.
@@ -834,19 +840,36 @@ def map_blocks(
     else:
         adjust_chunks = None
 
-    out = blockwise(
-        func,
-        out_ind,
-        *concat(argpairs),
-        name=name,
-        new_axes=new_axes,
-        dtype=dtype,
-        concatenate=True,
-        align_arrays=False,
-        adjust_chunks=adjust_chunks,
-        meta=meta,
-        **kwargs,
-    )
+    if enforce_ndim:
+        out = blockwise(
+            apply_and_enforce,
+            out_ind,
+            *concat(argpairs),
+            expected_ndim=len(out_ind),
+            _func=func,
+            name=name,
+            new_axes=new_axes,
+            dtype=dtype,
+            concatenate=True,
+            align_arrays=False,
+            adjust_chunks=adjust_chunks,
+            meta=meta,
+            **kwargs,
+        )
+    else:
+        out = blockwise(
+            func,
+            out_ind,
+            *concat(argpairs),
+            name=name,
+            new_axes=new_axes,
+            dtype=dtype,
+            concatenate=True,
+            align_arrays=False,
+            adjust_chunks=adjust_chunks,
+            meta=meta,
+            **kwargs,
+        )
 
     extra_argpairs = []
     extra_names = []
@@ -971,6 +994,22 @@ def map_blocks(
     return out
 
 
+def apply_and_enforce(*args, **kwargs):
+    """Apply a function, and enforce the output.ndim to match expected_ndim
+
+    Ensures the output has the expected dimensionality."""
+    func = kwargs.pop("_func")
+    expected_ndim = kwargs.pop("expected_ndim")
+    out = func(*args, **kwargs)
+    if getattr(out, "ndim", 0) != expected_ndim:
+        out_ndim = getattr(out, "ndim", 0)
+        raise ValueError(
+            f"Dimension mismatch: expected output of {func} "
+            f"to have dims = {expected_ndim}.  Got {out_ndim} instead."
+        )
+    return out
+
+
 def broadcast_chunks(*chunkss):
     """Construct a chunks tuple that broadcasts many chunks tuples
 
@@ -4905,7 +4944,7 @@ def chunks_from_arrays(arrays):
 
     def shape(x):
         try:
-            return x.shape
+            return x.shape if x.shape else (1,)
         except AttributeError:
             return (1,)
 
diff --git a/dask/array/utils.py b/dask/array/utils.py
--- a/dask/array/utils.py
+++ b/dask/array/utils.py
@@ -210,7 +210,10 @@ def _check_dsk(dsk):
     assert not non_one, non_one
 
 
-def assert_eq_shape(a, b, check_nan=True):
+def assert_eq_shape(a, b, check_ndim=True, check_nan=True):
+    if check_ndim:
+        assert len(a) == len(b)
+
     for aa, bb in zip(a, b):
         if math.isnan(aa) or math.isnan(bb):
             if check_nan:
@@ -219,7 +222,7 @@ def assert_eq_shape(a, b, check_nan=True):
             assert aa == bb
 
 
-def _check_chunks(x, scheduler=None):
+def _check_chunks(x, check_ndim=True, scheduler=None):
     x = x.persist(scheduler=scheduler)
     for idx in itertools.product(*(range(len(c)) for c in x.chunks)):
         chunk = x.dask[(x.name,) + idx]
@@ -228,7 +231,9 @@ def _check_chunks(x, scheduler=None):
         if not hasattr(chunk, "dtype"):
             chunk = np.array(chunk, dtype="O")
         expected_shape = tuple(c[i] for c, i in zip(x.chunks, idx))
-        assert_eq_shape(expected_shape, chunk.shape, check_nan=False)
+        assert_eq_shape(
+            expected_shape, chunk.shape, check_ndim=check_ndim, check_nan=False
+        )
         assert (
             chunk.dtype == x.dtype
         ), "maybe you forgot to pass the scheduler to `assert_eq`?"
@@ -236,7 +241,12 @@ def _check_chunks(x, scheduler=None):
 
 
 def _get_dt_meta_computed(
-    x, check_shape=True, check_graph=True, check_chunks=True, scheduler=None
+    x,
+    check_shape=True,
+    check_graph=True,
+    check_chunks=True,
+    check_ndim=True,
+    scheduler=None,
 ):
     x_original = x
     x_meta = None
@@ -250,7 +260,7 @@ def _get_dt_meta_computed(
         x_meta = getattr(x, "_meta", None)
         if check_chunks:
             # Replace x with persisted version to avoid computing it twice.
-            x = _check_chunks(x, scheduler=scheduler)
+            x = _check_chunks(x, check_ndim=check_ndim, scheduler=scheduler)
         x = x.compute(scheduler=scheduler)
         x_computed = x
         if hasattr(x, "todense"):
@@ -276,6 +286,7 @@ def assert_eq(
     check_graph=True,
     check_meta=True,
     check_chunks=True,
+    check_ndim=True,
     check_type=True,
     check_dtype=True,
     equal_nan=True,
@@ -295,6 +306,7 @@ def assert_eq(
         check_shape=check_shape,
         check_graph=check_graph,
         check_chunks=check_chunks,
+        check_ndim=check_ndim,
         scheduler=scheduler,
     )
     b, bdt, b_meta, b_computed = _get_dt_meta_computed(
@@ -302,6 +314,7 @@ def assert_eq(
         check_shape=check_shape,
         check_graph=check_graph,
         check_chunks=check_chunks,
+        check_ndim=check_ndim,
         scheduler=scheduler,
     )
 

Thanks for writing this up @dcherian! I hadn't realized that we fail for this case on the array side. On the dataframe side we seem to handle this more gracefully, so we can probably mimic that on the array side.

```python
import dask.dataframe as dd

ddf = dd.from_array(array)
ddf.map_partitions(np.mean).compute()
```
I guess the general version of this problem is that the mapped function returns a value that has dimensionality different from what is expected.
@jsignell 

I think I agree with you that `dask.array` ought to be able to handle this case more gracefully.  In particular, I think this case should be able to return the exact same result as:
```python
array.map_blocks(lambda x: np.mean(x, keepdims=True), chunks=output_chunks).compute()
```
simply because of `dask`'s ability to broadcast the return value of `np.mean` to the expected shape during `compute()`.

I mean, the following calls work without hiccups:
```python
array.map_blocks(lambda x: np.array([[1]]), chunks=output_chunks).compute()
array.map_blocks(lambda x: np.array([[[1]]]), chunks=output_chunks).compute()
```
so why not the former?

Somewhere along the call-chain of the above error tracelog of @dcherian's case there's a curious piece of source code:
https://github.com/dask/dask/blob/e1a19cbd80c462371eb50e7cf309a8fc47d9bb45/dask/array/core.py#L4855-L4860
which seems to allow scalars `x` to be interpreted as arrays of shape `(1,)`.  But `np.mean([1, 1])`, for example, returns an object `x` that has `x.shape = ()`, which I'm guessing was unexpected at the time this piece of code was written.  

I think changing it to:
```python =
 def shape(x): 
     try: 
         return x.shape if x.shape else (1,)
     except AttributeError: 
         return (1,) 
 ```
will allow @dcherian 's case to run through without raising an error.
diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -5236,3 +5236,61 @@ def test_len_object_with_unknown_size():
     b = a[a < 0.5]
     with pytest.raises(ValueError, match="on object with unknown chunk size"):
         assert len(b)
+
+
+@pytest.mark.parametrize("ndim", [0, 1, 3, 8])
+def test_chunk_shape_broadcast(ndim):
+    from functools import partial
+
+    def f(x, ndim=0):
+        # Ignore `x` and return arbitrary one-element array of dimensionality `ndim`
+        # For example,
+        # f(x, 0) = array(5)
+        # f(x, 1) = array([5])
+        # f(x, 2) = array([[5]])
+        # f(x, 3) = array([[[5]]])
+        return np.array(5)[(np.newaxis,) * ndim]
+
+    array = da.from_array([1] + [2, 2] + [3, 3, 3], chunks=((1, 2, 3),))
+    out_chunks = ((1, 1, 1),)
+
+    # check ``enforce_ndim`` keyword parameter of ``map_blocks()``
+    out = array.map_blocks(partial(f, ndim=ndim), chunks=out_chunks, enforce_ndim=True)
+
+    if ndim != 1:
+        with pytest.raises(ValueError, match="Dimension mismatch:"):
+            out.compute()
+    else:
+        out.compute()  # should not raise an exception
+
+    # check ``check_ndim`` keyword parameter of ``assert_eq()``
+    out = array.map_blocks(partial(f, ndim=ndim), chunks=out_chunks)
+    expected = np.array([5, 5, 5])
+    try:
+        assert_eq(out, expected)
+    except AssertionError:
+        assert_eq(out, expected, check_ndim=False)
+    else:
+        if ndim != 1:
+            raise AssertionError("Expected a ValueError: Dimension mismatch")
+
+
+def test_chunk_non_array_like():
+    array = da.from_array([1] + [2, 2] + [3, 3, 3], chunks=((1, 2, 3),))
+    out_chunks = ((1, 1, 1),)
+
+    # check ``enforce_ndim`` keyword parameter of ``map_blocks()``
+    out = array.map_blocks(lambda x: 5, chunks=out_chunks, enforce_ndim=True)
+
+    with pytest.raises(ValueError, match="Dimension mismatch:"):
+        out.compute()
+
+    expected = np.array([5, 5, 5])
+    # check ``check_ndim`` keyword parameter of ``assert_eq()``
+    out = array.map_blocks(lambda x: 5, chunks=out_chunks)
+    try:
+        assert_eq(out, expected)
+    except AssertionError:
+        assert_eq(out, expected, check_chunks=False)
+    else:
+        raise AssertionError("Expected a ValueError: Dimension mismatch")

Confusing error from map_blocks if function returns scalar per block
<!-- Please include a self-contained copy-pastable example that generates the issue if possible.

Please be concise with code posted. See guidelines below on how to provide a good bug report:

- Craft Minimal Bug Reports http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
- Minimal Complete Verifiable Examples https://stackoverflow.com/help/mcve

Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly.
-->

**What happened**:

`map_blocks` raises a confusing error when the mapped function returns a scalar.

**What you expected to happen**:

Let the user know that the function should return a single element array.

**Minimal Complete Verifiable Example**:

```python
import numpy as np
import dask.array as da

array = da.from_array([1,1,2,2,2,3,3,3,3,3], chunks=((2,3,5)))
nchunks = len(array.chunks[0])
output_chunks = ([1] * nchunks,)

array.map_blocks(np.mean, chunks=output_chunks).compute()
```

```
File ~/mambaforge/envs/dcpy/lib/python3.8/site-packages/dask/array/core.py:4994, in concatenate3(arrays)
   4992 if not ndim:
   4993     return arrays
-> 4994 chunks = chunks_from_arrays(arrays)
   4995 shape = tuple(map(sum, chunks))
   4997 def dtype(x):

File ~/mambaforge/envs/dcpy/lib/python3.8/site-packages/dask/array/core.py:4781, in chunks_from_arrays(arrays)
   4778         return (1,)
   4780 while isinstance(arrays, (list, tuple)):
-> 4781     result.append(tuple(shape(deepfirst(a))[dim] for a in arrays))
   4782     arrays = arrays[0]
   4783     dim += 1

File ~/mambaforge/envs/dcpy/lib/python3.8/site-packages/dask/array/core.py:4781, in <genexpr>(.0)
   4778         return (1,)
   4780 while isinstance(arrays, (list, tuple)):
-> 4781     result.append(tuple(shape(deepfirst(a))[dim] for a in arrays))
   4782     arrays = arrays[0]
   4783     dim += 1

IndexError: tuple index out of range
```

**Anything else we need to know?**:

If I amke the fuction return a single element array, it works

```
array.map_blocks(lambda x: np.mean(x, keepdims=True), chunks=output_chunks).compute()
```

**Environment**:

- Dask version: 2021.12.0
- Python version: 3.10
- Operating System: macOS
- Install method (conda, pip, source): conda


dask/array/tests/test_array_core.py::test_chunk_non_array_like dask/array/tests/test_array_core.py::test_chunk_shape_broadcast[8] dask/array/tests/test_array_core.py::test_chunk_shape_broadcast[1] dask/array/tests/test_array_core.py::test_chunk_shape_broadcast[3] dask/array/tests/test_array_core.py::test_chunk_shape_broadcast[0]
dask/array/tests/test_array_core.py::test_normalize_chunks_nan dask/array/tests/test_array_core.py::test_stack_scalars dask/array/tests/test_array_core.py::test_astype dask/array/tests/test_array_core.py::test_meta[dtype1] dask/array/tests/test_array_core.py::test_vindex_basic dask/array/tests/test_array_core.py::test_from_array_with_missing_chunks dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index11-value11] dask/array/tests/test_array_core.py::test_reshape[original_shape15-new_shape15-2] dask/array/tests/test_array_core.py::test_from_array_scalar[int32] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index18-value18] dask/array/tests/test_array_core.py::test_elemwise_uneven_chunks dask/array/tests/test_array_core.py::test_setitem_hardmask dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape3-v_shape3] dask/array/tests/test_array_core.py::test_to_hdf5 dask/array/tests/test_array_core.py::test_matmul dask/array/tests/test_array_core.py::test_map_blocks_block_info_with_new_axis dask/array/tests/test_array_core.py::test_to_delayed_optimize_graph dask/array/tests/test_array_core.py::test_concatenate_axes dask/array/tests/test_array_core.py::test_broadcast_to_scalar dask/array/tests/test_array_core.py::test_reshape[original_shape31-new_shape31-chunks31] dask/array/tests/test_array_core.py::test_Array_computation dask/array/tests/test_array_core.py::test_store_deterministic_keys[True-False] dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_to_zarr dask/array/tests/test_array_core.py::test_normalize_chunks_tuples_of_tuples dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape4-v_shape4] dask/array/tests/test_array_core.py::test_no_chunks_yes_chunks dask/array/tests/test_array_core.py::test_map_blocks_block_info dask/array/tests/test_array_core.py::test_asanyarray dask/array/tests/test_array_core.py::test_broadcast_to_chunks dask/array/tests/test_array_core.py::test_block_simple_column_wise dask/array/tests/test_array_core.py::test_vindex_negative dask/array/tests/test_array_core.py::test_blockwise_zero_shape_new_axes dask/array/tests/test_array_core.py::test_normalize_chunks_auto_2d[shape2-auto-10-expected2] dask/array/tests/test_array_core.py::test_slice_reversed dask/array/tests/test_array_core.py::test_keys dask/array/tests/test_array_core.py::test_store_compute_false dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape0-chunks0-reshape_size0-None] dask/array/tests/test_array_core.py::test_reshape[original_shape9-new_shape9-2] dask/array/tests/test_array_core.py::test_map_blocks_with_changed_dimension dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[3-value7] dask/array/tests/test_array_core.py::test_broadcast_against_zero_shape dask/array/tests/test_array_core.py::test_reshape[original_shape28-new_shape28-chunks28] dask/array/tests/test_array_core.py::test_repr_html_array_highlevelgraph dask/array/tests/test_array_core.py::test_repr_meta dask/array/tests/test_array_core.py::test_slicing_with_ellipsis dask/array/tests/test_array_core.py::test_elemwise_with_lists[other0-100] dask/array/tests/test_array_core.py::test_block_with_1d_arrays_column_wise dask/array/tests/test_array_core.py::test_from_array_scalar[uint64] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index16--1] dask/array/tests/test_array_core.py::test_block_no_lists dask/array/tests/test_array_core.py::test_delayed_array_key_hygeine dask/array/tests/test_array_core.py::test_len_object_with_unknown_size dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index2--1] dask/array/tests/test_array_core.py::test_from_array_scalar[int64] dask/array/tests/test_array_core.py::test_chunked_dot_product dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index9-value9] dask/array/tests/test_array_core.py::test_reshape[original_shape24-new_shape24-6] dask/array/tests/test_array_core.py::test_from_array_scalar[datetime64] dask/array/tests/test_array_core.py::test_bool dask/array/tests/test_array_core.py::test_from_array_no_asarray[True-False-matrix] dask/array/tests/test_array_core.py::test_normalize_chunks_auto_2d[shape0-chunks0-20-expected0] dask/array/tests/test_array_core.py::test_reshape[original_shape3-new_shape3-12] dask/array/tests/test_array_core.py::test_reshape[original_shape17-new_shape17-3] dask/array/tests/test_array_core.py::test_normalize_chunks dask/array/tests/test_array_core.py::test_elemwise_dtype dask/array/tests/test_array_core.py::test_from_array_minus_one dask/array/tests/test_array_core.py::test_map_blocks_with_invalid_drop_axis dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index20-value20] dask/array/tests/test_array_core.py::test_3925 dask/array/tests/test_array_core.py::test_memmap dask/array/tests/test_array_core.py::test_slicing_with_object_dtype dask/array/tests/test_array_core.py::test_from_array_scalar[timedelta64] dask/array/tests/test_array_core.py::test_vindex_identity dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape5-v_shape5] dask/array/tests/test_array_core.py::test_graph_from_arraylike[True] dask/array/tests/test_array_core.py::test_from_array_scalar[int] dask/array/tests/test_array_core.py::test_long_slice dask/array/tests/test_array_core.py::test_reshape[original_shape13-new_shape13-2] dask/array/tests/test_array_core.py::test_field_access_with_shape dask/array/tests/test_array_core.py::test_vindex_errors dask/array/tests/test_array_core.py::test_from_array_scalar[int8] dask/array/tests/test_array_core.py::test_map_blocks_with_negative_drop_axis dask/array/tests/test_array_core.py::test_block_empty_lists dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape1-v_shape1] dask/array/tests/test_array_core.py::test_store_delayed_target dask/array/tests/test_array_core.py::test_align_chunks_to_previous_chunks dask/array/tests/test_array_core.py::test_from_array_scalar[object_] dask/array/tests/test_array_core.py::test_regular_chunks[data6] dask/array/tests/test_array_core.py::test_from_array_scalar[int16] dask/array/tests/test_array_core.py::test_h5py_newaxis dask/array/tests/test_array_core.py::test_arithmetic dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index3--1] dask/array/tests/test_array_core.py::test_from_array_ndarray_getitem dask/array/tests/test_array_core.py::test_from_array_with_lock[True] dask/array/tests/test_array_core.py::test_reshape[original_shape4-new_shape4-12] dask/array/tests/test_array_core.py::test_asarray_h5py[False-asarray] dask/array/tests/test_array_core.py::test_block_tuple dask/array/tests/test_array_core.py::test_no_warnings_from_blockwise dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index10-value10] dask/array/tests/test_array_core.py::test_getter dask/array/tests/test_array_core.py::test_compute_chunk_sizes dask/array/tests/test_array_core.py::test_reshape[original_shape33-new_shape33-chunks33] dask/array/tests/test_array_core.py::test_elemwise_with_ndarrays dask/array/tests/test_array_core.py::test_elemwise_differently_chunked dask/array/tests/test_array_core.py::test_setitem_extended_API_2d_rhs_func_of_lhs dask/array/tests/test_array_core.py::test_slice_with_integer_types dask/array/tests/test_array_core.py::test_copy_mutate dask/array/tests/test_array_core.py::test_auto_chunks_h5py dask/array/tests/test_array_core.py::test_store_regions dask/array/tests/test_array_core.py::test_chunk_assignment_invalidates_cached_properties dask/array/tests/test_array_core.py::test_constructors_chunks_dict dask/array/tests/test_array_core.py::test_zarr_inline_array[True] dask/array/tests/test_array_core.py::test_setitem_extended_API_0d dask/array/tests/test_array_core.py::test_stack_promote_type dask/array/tests/test_array_core.py::test_from_array_dask_array dask/array/tests/test_array_core.py::test_h5py_tokenize dask/array/tests/test_array_core.py::test_block_mixed_1d_and_2d dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index2--3] dask/array/tests/test_array_core.py::test_elemwise_on_scalars dask/array/tests/test_array_core.py::test_chunked_transpose_plus_one dask/array/tests/test_array_core.py::test_reshape[original_shape32-new_shape32-chunks32] dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index4--4] dask/array/tests/test_array_core.py::test_store_kwargs dask/array/tests/test_array_core.py::test_zarr_regions dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[False-x2-1] dask/array/tests/test_array_core.py::test_elemwise_with_lists[other2-6] dask/array/tests/test_array_core.py::test_np_array_with_zero_dimensions dask/array/tests/test_array_core.py::test_concatenate3_2 dask/array/tests/test_array_core.py::test_concatenate3_nep18_dispatching[False] dask/array/tests/test_array_core.py::test_from_array_getitem[False-False] dask/array/tests/test_array_core.py::test_regular_chunks[data5] dask/array/tests/test_array_core.py::test_numblocks_suppoorts_singleton_block_dims dask/array/tests/test_array_core.py::test_reshape_splat dask/array/tests/test_array_core.py::test_map_blocks_unique_name_drop_axis dask/array/tests/test_array_core.py::test_from_array_scalar[uint16] dask/array/tests/test_array_core.py::test_from_array_scalar[uint32] dask/array/tests/test_array_core.py::test_broadcast_dimensions dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index1--2] dask/array/tests/test_array_core.py::test_reshape[original_shape0-new_shape0-chunks0] dask/array/tests/test_array_core.py::test_elemwise_name dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index14--1] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index8-value8] dask/array/tests/test_array_core.py::test_from_array_scalar[longdouble] dask/array/tests/test_array_core.py::test_from_array_list[x0] dask/array/tests/test_array_core.py::test_store_deterministic_keys[False-True] dask/array/tests/test_array_core.py::test_from_array_meta dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x0] dask/array/tests/test_array_core.py::test_from_array_scalar[clongdouble] dask/array/tests/test_array_core.py::test_block_nested dask/array/tests/test_array_core.py::test_reshape[original_shape8-new_shape8-4] dask/array/tests/test_array_core.py::test_blockwise_zero_shape dask/array/tests/test_array_core.py::test_broadcast_arrays dask/array/tests/test_array_core.py::test_reshape[original_shape25-new_shape25-6] dask/array/tests/test_array_core.py::test_Array_numpy_gufunc_call__array_ufunc__02 dask/array/tests/test_array_core.py::test_from_zarr_name dask/array/tests/test_array_core.py::test_reshape[original_shape14-new_shape14-2] dask/array/tests/test_array_core.py::test_blockwise_1_in_shape_III dask/array/tests/test_array_core.py::test_reshape[original_shape5-new_shape5-chunks5] dask/array/tests/test_array_core.py::test_map_blocks_token_deprecated dask/array/tests/test_array_core.py::test_map_blocks_optimize_blockwise[<lambda>0] dask/array/tests/test_array_core.py::test_index_with_integer_types dask/array/tests/test_array_core.py::test_map_blocks_infer_chunks_broadcast dask/array/tests/test_array_core.py::test_no_chunks dask/array/tests/test_array_core.py::test_from_array_no_asarray[False-False-matrix] dask/array/tests/test_array_core.py::test_from_array_scalar[uint8] dask/array/tests/test_array_core.py::test_from_array_getitem[True-True] dask/array/tests/test_array_core.py::test_map_blocks_optimize_blockwise[<lambda>1] dask/array/tests/test_array_core.py::test_scipy_sparse_concatenate[1] dask/array/tests/test_array_core.py::test_optimize dask/array/tests/test_array_core.py::test_elemwise_with_lists[other1-6] dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index3-value3] dask/array/tests/test_array_core.py::test_Array dask/array/tests/test_array_core.py::test_repr dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index1--1] dask/array/tests/test_array_core.py::test_graph_from_arraylike[False] dask/array/tests/test_array_core.py::test_reshape_unknown_dimensions dask/array/tests/test_array_core.py::test_concatenate_types[dtypes0] dask/array/tests/test_array_core.py::test_concatenate_rechunk dask/array/tests/test_array_core.py::test_from_array_scalar[float] dask/array/tests/test_array_core.py::test_concatenate_zero_size dask/array/tests/test_array_core.py::test_no_chunks_2d dask/array/tests/test_array_core.py::test_top_with_kwargs dask/array/tests/test_array_core.py::test_reshape_warns_by_default_if_it_is_producing_large_chunks dask/array/tests/test_array_core.py::test_zarr_pass_mapper dask/array/tests/test_array_core.py::test_dont_dealias_outputs dask/array/tests/test_array_core.py::test_view_fortran dask/array/tests/test_array_core.py::test_stack dask/array/tests/test_array_core.py::test_top dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[24-5-expected3] dask/array/tests/test_array_core.py::test_point_slicing dask/array/tests/test_array_core.py::test_setitem_2d dask/array/tests/test_array_core.py::test_store_method_return dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index19--99] dask/array/tests/test_array_core.py::test_pandas_from_dask_array dask/array/tests/test_array_core.py::test_broadcast_arrays_uneven_chunks dask/array/tests/test_array_core.py::test_from_array_name dask/array/tests/test_array_core.py::test_blockwise_1_in_shape_I dask/array/tests/test_array_core.py::test_store_nocompute_regions dask/array/tests/test_array_core.py::test_array_picklable[array1] dask/array/tests/test_array_core.py::test_timedelta_op dask/array/tests/test_array_core.py::test_compute_chunk_sizes_2d_array dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index8--4] dask/array/tests/test_array_core.py::test_block_with_1d_arrays_row_wise dask/array/tests/test_array_core.py::test_from_array_scalar[complex128] dask/array/tests/test_array_core.py::test_vindex_merge dask/array/tests/test_array_core.py::test_from_array_dask_collection_warns dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index6-value6] dask/array/tests/test_array_core.py::test_block_with_1d_arrays_multiple_rows dask/array/tests/test_array_core.py::test_store_deterministic_keys[False-False] dask/array/tests/test_array_core.py::test_broadcast_shapes dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[True-x2-1] dask/array/tests/test_array_core.py::test_warn_bad_rechunking dask/array/tests/test_array_core.py::test_map_blocks dask/array/tests/test_array_core.py::test_store_deterministic_keys[True-True] dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x5] dask/array/tests/test_array_core.py::test_elemwise_with_lists[other0-6] dask/array/tests/test_array_core.py::test_zarr_group dask/array/tests/test_array_core.py::test_block_complicated dask/array/tests/test_array_core.py::test_concatenate_stack_dont_warn dask/array/tests/test_array_core.py::test_block_simple_row_wise dask/array/tests/test_array_core.py::test_from_array_scalar[complex] dask/array/tests/test_array_core.py::test_common_blockdim dask/array/tests/test_array_core.py::test_raise_informative_errors_no_chunks dask/array/tests/test_array_core.py::test_map_blocks_no_array_args dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[False-x3-1] dask/array/tests/test_array_core.py::test_store dask/array/tests/test_array_core.py::test_reshape[original_shape29-new_shape29-chunks29] dask/array/tests/test_array_core.py::test_raise_on_bad_kwargs dask/array/tests/test_array_core.py::test_zarr_nocompute dask/array/tests/test_array_core.py::test_reshape[original_shape12-new_shape12-2] dask/array/tests/test_array_core.py::test_reshape[original_shape30-new_shape30-chunks30] dask/array/tests/test_array_core.py::test_map_blocks_with_changed_dimension_and_broadcast_chunks dask/array/tests/test_array_core.py::test_no_chunks_slicing_2d dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index4--1] dask/array/tests/test_array_core.py::test_block_with_mismatched_shape dask/array/tests/test_array_core.py::test_from_array_scalar[bytes] dask/array/tests/test_array_core.py::test_dtype dask/array/tests/test_array_core.py::test_to_zarr_unknown_chunks_raises dask/array/tests/test_array_core.py::test_map_blocks_with_constants dask/array/tests/test_array_core.py::test_uneven_chunks_that_fit_neatly dask/array/tests/test_array_core.py::test_asarray_chunks dask/array/tests/test_array_core.py::test_from_array_chunks_dict dask/array/tests/test_array_core.py::test_scipy_sparse_concatenate[0] dask/array/tests/test_array_core.py::test_from_array_scalar[str] dask/array/tests/test_array_core.py::test_map_blocks_block_info_with_drop_axis dask/array/tests/test_array_core.py::test_setitem_1d dask/array/tests/test_array_core.py::test_blockdims_from_blockshape dask/array/tests/test_array_core.py::test_T dask/array/tests/test_array_core.py::test_zarr_existing_array dask/array/tests/test_array_core.py::test_normalize_chunks_object_dtype[object] dask/array/tests/test_array_core.py::test_zero_sized_array_rechunk dask/array/tests/test_array_core.py::test_reshape[original_shape27-new_shape27-chunks27] dask/array/tests/test_array_core.py::test_reshape[original_shape11-new_shape11-2] dask/array/tests/test_array_core.py::test_reshape[original_shape6-new_shape6-4] dask/array/tests/test_array_core.py::test_elemwise_consistent_names dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x4] dask/array/tests/test_array_core.py::test_blockwise_1_in_shape_II dask/array/tests/test_array_core.py::test_from_array_raises_on_bad_chunks dask/array/tests/test_array_core.py::test_matmul_array_ufunc dask/array/tests/test_array_core.py::test_regular_chunks[data7] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d_mask[index0-value0] dask/array/tests/test_array_core.py::test_map_blocks_chunks dask/array/tests/test_array_core.py::test_view dask/array/tests/test_array_core.py::test_map_blocks_name dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape0-v_shape0] dask/array/tests/test_array_core.py::test_reshape[original_shape26-new_shape26-chunks26] dask/array/tests/test_array_core.py::test_Array_numpy_gufunc_call__array_ufunc__01 dask/array/tests/test_array_core.py::test_from_array_getitem[True-False] dask/array/tests/test_array_core.py::test_broadcast_to dask/array/tests/test_array_core.py::test_regular_chunks[data4] dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[False-x1--1] dask/array/tests/test_array_core.py::test_nbytes_auto dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index21--98] dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape6-v_shape6] dask/array/tests/test_array_core.py::test_array_compute_forward_kwargs dask/array/tests/test_array_core.py::test_tiledb_roundtrip dask/array/tests/test_array_core.py::test_reshape[original_shape18-new_shape18-4] dask/array/tests/test_array_core.py::test_normalize_chunks_object_dtype[dtype1] dask/array/tests/test_array_core.py::test_broadcast_operator[u_shape2-v_shape2] dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_slicing dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index9--5] dask/array/tests/test_array_core.py::test_from_array_list[x2] dask/array/tests/test_array_core.py::test_map_blocks_with_chunks dask/array/tests/test_array_core.py::test_from_array_scalar[bytes_] dask/array/tests/test_array_core.py::test_stack_errs dask/array/tests/test_array_core.py::test_from_array_with_lock[False] dask/array/tests/test_array_core.py::test_dont_fuse_outputs dask/array/tests/test_array_core.py::test_blocks_indexer dask/array/tests/test_array_core.py::test_reshape[original_shape16-new_shape16-chunks16] dask/array/tests/test_array_core.py::test_itemsize dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_concatenate dask/array/tests/test_array_core.py::test_from_array_list[x1] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index17--1] dask/array/tests/test_array_core.py::test_index_array_with_array_2d dask/array/tests/test_array_core.py::test_array_picklable[array0] dask/array/tests/test_array_core.py::test_asarray[asanyarray] dask/array/tests/test_array_core.py::test_zarr_return_stored[True] dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[False-x0-chunks0] dask/array/tests/test_array_core.py::test_broadcast_chunks dask/array/tests/test_array_core.py::test_slicing_with_non_ndarrays dask/array/tests/test_array_core.py::test_uneven_chunks dask/array/tests/test_array_core.py::test_cumulative dask/array/tests/test_array_core.py::test_map_blocks_infer_newaxis dask/array/tests/test_array_core.py::test_reshape[original_shape34-new_shape34-chunks34] dask/array/tests/test_array_core.py::test_reshape[original_shape23-new_shape23-6] dask/array/tests/test_array_core.py::test_map_blocks_delayed dask/array/tests/test_array_core.py::test_slice_with_floats dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index0--1] dask/array/tests/test_array_core.py::test_blockview dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[True-x1--1] dask/array/tests/test_array_core.py::test_dask_array_holds_scipy_sparse_containers dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[23-5-expected4] dask/array/tests/test_array_core.py::test_slicing_with_ndarray dask/array/tests/test_array_core.py::test_from_array_scalar[bool] dask/array/tests/test_array_core.py::test_reshape[original_shape22-new_shape22-24] dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[True-x0-chunks0] dask/array/tests/test_array_core.py::test_map_blocks_large_inputs_delayed dask/array/tests/test_array_core.py::test_empty_array dask/array/tests/test_array_core.py::test_asanyarray_datetime64 dask/array/tests/test_array_core.py::test_zero_slice_dtypes dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index0--1] dask/array/tests/test_array_core.py::test_regular_chunks[data3] dask/array/tests/test_array_core.py::test_reshape[original_shape2-new_shape2-5] dask/array/tests/test_array_core.py::test_normalize_chunks_auto_2d[shape1-chunks1-20-expected1] dask/array/tests/test_array_core.py::test_zarr_return_stored[False] dask/array/tests/test_array_core.py::test_chunks_is_immutable dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index10-value10] dask/array/tests/test_array_core.py::test_from_array_scalar[float16] dask/array/tests/test_array_core.py::test_map_blocks2 dask/array/tests/test_array_core.py::test_blockwise_large_inputs_delayed dask/array/tests/test_array_core.py::test_operator_dtype_promotion dask/array/tests/test_array_core.py::test_reshape[original_shape7-new_shape7-4] dask/array/tests/test_array_core.py::test_ellipsis_slicing dask/array/tests/test_array_core.py::test_from_array_copy dask/array/tests/test_array_core.py::test_concatenate_errs dask/array/tests/test_array_core.py::test_to_delayed dask/array/tests/test_array_core.py::test_vindex_nd dask/array/tests/test_array_core.py::test_npartitions dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[100-10-expected0] dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x3] dask/array/tests/test_array_core.py::test_compute_chunk_sizes_3d_array dask/array/tests/test_array_core.py::test_regular_chunks[data1] dask/array/tests/test_array_core.py::test_top_supports_broadcasting_rules dask/array/tests/test_array_core.py::test_from_delayed dask/array/tests/test_array_core.py::test_broadcast_to_array dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index5-value5] dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[20-10-expected1] dask/array/tests/test_array_core.py::test_from_array_scalar[longlong] dask/array/tests/test_array_core.py::test_zarr_roundtrip_with_path_like dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index13-value13] dask/array/tests/test_array_core.py::test_block_3d dask/array/tests/test_array_core.py::test_reshape_exceptions dask/array/tests/test_array_core.py::test_blockwise_literals dask/array/tests/test_array_core.py::test_from_delayed_meta dask/array/tests/test_array_core.py::test_Array_normalizes_dtype dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index7--6] dask/array/tests/test_array_core.py::test_asarray_h5py[True-asanyarray] dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_rechunk dask/array/tests/test_array_core.py::test_top_literals dask/array/tests/test_array_core.py::test_operators dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_to_svg dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape1-chunks1-reshape_size1-67108864] dask/array/tests/test_array_core.py::test_from_array_scalar[float64] dask/array/tests/test_array_core.py::test_asarray_h5py[True-asarray] dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x2] dask/array/tests/test_array_core.py::test_map_blocks_with_kwargs dask/array/tests/test_array_core.py::test_normalize_chunks_auto_3d dask/array/tests/test_array_core.py::test_from_array_scalar[bool_] dask/array/tests/test_array_core.py::test_stack_rechunk dask/array/tests/test_array_core.py::test_reshape[original_shape1-new_shape1-5] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index15--1] dask/array/tests/test_array_core.py::test_regular_chunks[data2] dask/array/tests/test_array_core.py::test_concatenate_types[dtypes1] dask/array/tests/test_array_core.py::test_from_array_getitem[False-True] dask/array/tests/test_array_core.py::test_reshape[original_shape21-new_shape21-1] dask/array/tests/test_array_core.py::test_stack_zero_size dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape0-chunks0-reshape_size0-67108864] dask/array/tests/test_array_core.py::test_broadcast_dimensions_works_with_singleton_dimensions dask/array/tests/test_array_core.py::test_from_array_ndarray_onechunk[x1] dask/array/tests/test_array_core.py::test_A_property dask/array/tests/test_array_core.py::test_from_array_inline dask/array/tests/test_array_core.py::test_full dask/array/tests/test_array_core.py::test_from_array_scalar[void] dask/array/tests/test_array_core.py::test_concatenate dask/array/tests/test_array_core.py::test_map_blocks_block_info_with_broadcast dask/array/tests/test_array_core.py::test_size dask/array/tests/test_array_core.py::test_from_array_no_asarray[False-True-ndarray] dask/array/tests/test_array_core.py::test_meta[None] dask/array/tests/test_array_core.py::test_reshape_not_implemented_error dask/array/tests/test_array_core.py::test_partitions_indexer dask/array/tests/test_array_core.py::test_read_zarr_chunks dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[20-5-expected2] dask/array/tests/test_array_core.py::test_tiledb_multiattr dask/array/tests/test_array_core.py::test_from_array_scalar[ulonglong] dask/array/tests/test_array_core.py::test_reshape[original_shape10-new_shape10-2] dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape0-chunks0-reshape_size0-134217728] dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_reduction dask/array/tests/test_array_core.py::test_point_slicing_with_full_slice dask/array/tests/test_array_core.py::test_reshape[original_shape19-new_shape19-chunks19] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index22-value22] dask/array/tests/test_array_core.py::test_regular_chunks[data0] dask/array/tests/test_array_core.py::test_rechunk_auto dask/array/tests/test_array_core.py::test_reshape[original_shape20-new_shape20-1] dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index6--5] dask/array/tests/test_array_core.py::test_astype_gh1151 dask/array/tests/test_array_core.py::test_map_blocks_unique_name_new_axis dask/array/tests/test_array_core.py::test_to_npy_stack dask/array/tests/test_array_core.py::test_zarr_roundtrip dask/array/tests/test_array_core.py::test_slicing_flexible_type dask/array/tests/test_array_core.py::test_chunks_error dask/array/tests/test_array_core.py::test_dask_layers dask/array/tests/test_array_core.py::test_dtype_complex dask/array/tests/test_array_core.py::test_constructor_plugin dask/array/tests/test_array_core.py::test_concatenate_fixlen_strings dask/array/tests/test_array_core.py::test_uneven_chunks_blockwise dask/array/tests/test_array_core.py::test_map_blocks3 dask/array/tests/test_array_core.py::test_3851 dask/array/tests/test_array_core.py::test_concatenate_flatten dask/array/tests/test_array_core.py::test_block_invalid_nesting dask/array/tests/test_array_core.py::test_from_array_no_asarray[True-True-ndarray] dask/array/tests/test_array_core.py::test_elemwise_with_lists[other1-100] dask/array/tests/test_array_core.py::test_setitem_errs dask/array/tests/test_array_core.py::test_short_stack dask/array/tests/test_array_core.py::test_map_blocks_dtype_inference dask/array/tests/test_array_core.py::test_blockwise_concatenate dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape1-chunks1-reshape_size1-None] dask/array/tests/test_array_core.py::test_from_array_tasks_always_call_getter[True-x3-1] dask/array/tests/test_array_core.py::test_concatenate3_nep18_dispatching[True] dask/array/tests/test_array_core.py::test_setitem_on_read_only_blocks dask/array/tests/test_array_core.py::test_empty_chunks_in_array_len dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[index12-value12] dask/array/tests/test_array_core.py::test_setitem_extended_API_1d[index11-value11] dask/array/tests/test_array_core.py::test_from_array_scalar[complex64] dask/array/tests/test_array_core.py::test_no_warnings_on_metadata dask/array/tests/test_array_core.py::test_from_array_scalar[float32] dask/array/tests/test_array_core.py::test_from_zarr_unique_name dask/array/tests/test_array_core.py::test_nbytes dask/array/tests/test_array_core.py::test_concatenate3_on_scalars dask/array/tests/test_array_core.py::test_from_array_scalar[str_] dask/array/tests/test_array_core.py::test_store_locks dask/array/tests/test_array_core.py::test_blockwise_with_numpy_arrays dask/array/tests/test_array_core.py::test_raise_on_no_chunks dask/array/tests/test_array_core.py::test_asarray_h5py[False-asanyarray] dask/array/tests/test_array_core.py::test_index_array_with_array_1d dask/array/tests/test_array_core.py::test_from_func dask/array/tests/test_array_core.py::test_compute_chunk_sizes_warning_fixes_reshape dask/array/tests/test_array_core.py::test_zarr_inline_array[False] dask/array/tests/test_array_core.py::test_asarray[asarray] dask/array/tests/test_array_core.py::test_setitem_extended_API_2d_mask[index1-value1] dask/array/tests/test_array_core.py::test_reshape_avoids_large_chunks[shape1-chunks1-reshape_size1-134217728] dask/array/tests/test_array_core.py::test_elemwise_with_lists[other2-100] dask/array/tests/test_array_core.py::test_normalize_chunks_auto_1d[1000-167-expected5] dask/array/tests/test_array_core.py::test_map_blocks_unique_name_chunks_dtype dask/array/tests/test_array_core.py::test_field_access dask/array/tests/test_array_core.py::test_setitem_extended_API_2d[5--1]