Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing cupy test mark and fixed cupy threshold #329

Conversation

m-albert
Copy link
Collaborator

@m-albert m-albert commented Aug 1, 2023

This PR fixes #327 by

  • adding the cupy mark to the ignored test
  • passing sigma in threshold_local (gaussian mode) as a numpy array instead of as an array of the same type as the input image.

@m-albert
Copy link
Collaborator Author

m-albert commented Aug 1, 2023

@m-albert
Copy link
Collaborator Author

m-albert commented Aug 1, 2023

On main, sigma which is later passed to gaussian_filter is created as a cupy backed dask array when the image is a cupy backed dask array.

sigma = (da.asarray(block_size, like=image._meta) - 1) / 6.0

This creates the error

???
E TypeError: Implicit conversion to a NumPy array is not allowed. Please use .get() to construct a NumPy array explicitly.
cupy/_core/core.pyx:1480: TypeError

I think the fix proposed here makes sense but I might be missing something:

sigma = (np.array(block_size).astype(float) - 1) / 6.0

@GenevieveBuckley GenevieveBuckley merged commit 264bd1d into dask:main Aug 2, 2023
11 checks passed
@GenevieveBuckley
Copy link
Collaborator

Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing GPU test that isn't run by the gpuCI
2 participants