Repository navigation
cupyx.ndimage.measurements: add center_of_mass, histogram, labeled_comprehension - #4311
Merged
mergify[bot] merged 3 commits intoDec 10, 2020
Merged
Conversation
Member
|
sorry to ask this, but could you please align the tests to those of #4307? Thanks! |
Member
Author
Sure. I will do it for the recent |
grlee77
force-pushed
the
ndimage_measurements_center_of_mass
branch
from
December 7, 2020 21:01
55be4ca to
50debde
Compare
remove unused code path use single quotes remove misplaced quote TST: make style of new tests consistent with changes in cupygh-4307
grlee77
force-pushed
the
ndimage_measurements_center_of_mass
branch
from
December 7, 2020 21:13
50debde to
5b11e68
Compare
Member
Author
|
rebased to fix merge conflict. should be ready for testing |
Member
|
TODO: Add docs |
Member
|
Jenkins, test this please |
Member
Author
I have already added this one to the API docs. |
Member
|
Jenkins CI test (for commit 5b11e68, target branch master) succeeded! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds three functions to
cupyx.scipy.ndimage.measurementscenter_of_masslabeled_comprehension(applies an arbitrary function over each labeled region)histogram(implemented vialabeled_comprehension)One difference in behavior was made to avoid the need for object arrays (in this case, an arrays where each element is an array). This is used for histogram which calls
labeled_comprehensionusingdtype=objectso that each element of the object array is the histogram over a particular label. For the CuPy implementation, a list of arrays is returned instead of an object array.If the return value is a scalar in the scipy implementation, a 0-dimensional device array is returned instead here to avoid device->host transfers as much as possible.
I also suppressed all instances of
cupy._util.PerformanceWarningoccuring in the tests of this module that existed prior to this PR.