code: def _compare_scipy_cupy(
      self, image, ignore_value, adaptive_index_dtype=False
  ):
      # run on CPU and GPU
      func_gpu = cupyx.scipy.ndimage.value_indices
      func_cpu = scipy.ndimage.value_indices
      val_idx = func_gpu(
          image,
          ignore_value=ignore_value,
          adaptive_index_dtype=adaptive_index_dtype,
      )
      # Note: Currently SciPy with 'q' (numpy.longlong) or
      #       'Q' (numpy.ulonglong) does not raise an error, but instead
      #       just silently returns an empty dictionary. That seems like a
      #       bug in SciPy so we cast to 64-bit here before calling SciPy and
      #       use that for the comparison.
      if image.dtype.char == "q":
          image_cpu = cupy.asnumpy(image).astype(cupy.int64)
      elif image.dtype.char == "Q":
          image_cpu = cupy.asnumpy(image).astype(cupy.uint64)
      else:
          image_cpu = cupy.asnumpy(image)
      expected_idx = func_cpu(image_cpu, ignore_value=ignore_value)
      assert val_idx.keys() == expected_idx.keys()
  
      # check all coordinate arrays in the dictionary
      for key, coords in val_idx.items():
          expected_coords = expected_idx[key]
          for c, expected_c in zip(coords, expected_coords):
              if adaptive_index_dtype:
                  # all array sizes used in the tests allow 8 or 16-bit
                  # coordinates
                  assert c.itemsize < expected_c.itemsize
  
                  # cast to SciPy type before comparison
                  c = c.astype(expected_c.dtype)
  
              cupy.testing.assert_array_equal(c, expected_c)
  
imports: import sys
  import warnings
  import numpy
  import pytest
  import cupy
  from cupy.cuda import runtime
  from cupy import testing
  from cupy import _util
  from cupy._core import _accelerator
  import cupyx.scipy.ndimage
label_desc: Use image node_id 2 for calling the TestValueIndices obj's underlying member method code with example usage: obj._compare_scipy_cupy(image, ignore_value, adaptive_index_dtype) without return types