code: def test_distance_transform_inplace_distance_errors(self, ndim):
      img = self._binary_image((32,) * ndim, xp=cupy, pct_true=80)
  
      dt_func = cupyx.scipy.ndimage.distance_transform_edt
  
      # for binary input, distances output is float32. Other dtypes raise
      with pytest.raises(RuntimeError):
          distances = cupy.empty(img.shape, dtype=cupy.float64)
          dt_func(img, distances=distances, float64_distances=False)
      with pytest.raises(RuntimeError):
          distances = cupy.empty(img.shape, dtype=cupy.int32)
          dt_func(img, distances=distances)
  
      # wrong shape
      with pytest.raises(RuntimeError):
          distances = cupy.empty(img.shape + (2,), dtype=cupy.float64)
          dt_func(img, distances=distances)
  
      # can't provide indices array when return_indices is False
      with pytest.raises(RuntimeError):
          distances = cupy.empty(img.shape, dtype=cupy.float64)
          dt_func(
              img,
              distances=distances,
              return_distances=False,
              return_indices=True,
          )
  
imports: import copy
  import numpy
  import pytest
  import cupy
  from cupy import testing
  import cupyx.scipy.ndimage
label_desc: Use image node_id 11 for calling the TestDistanceTransform obj's underlying member method code with example usage: obj.test_distance_transform_inplace_distance_errors(ndim) without return types