Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #869 +/- ##
=======================================
Coverage 96.86% 96.86%
=======================================
Files 128 128
Lines 26304 26324 +20
=======================================
+ Hits 25480 25500 +20
Misses 824 824 🚀 New features to boost your workflow:
|
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.
Types of changes
Description
ot.emdandot.emd2crash the Python interpreter with a segmentation fault when every entry of the cost matrix is NaN or infinite:Everything built on them crashes too, e.g.
ot.solve, andot.gromov.gromov_wasserstein2with an all-NaN structure matrix. That is the case #469 reported; it was closed because a single NaN now gives a NaN result, but a fully NaN matrix still crashes.Only the all-non-finite case crashes. With a NaN or inf row, column, block, or every entry but one, the solver returns an infeasible result (zero plan,
result_code0, the usual "Problem infeasible" warning). The dense solver call now goes through a small_emd_c_densehelper that returns that same infeasible result when no cost is finite, without callingemd_c. Every other input behaves exactly as before. With this,gromov_wasserstein2on an all-NaN structure returns NaN, as for a single NaN.How has this been tested
Added
test_emd_no_finite_cost(NaN and inf) intest/test_ot.py. It coversemd,emd2andgromov_wasserstein2, and it segfaults on master.test_ot.py,test_1d_solver.py,test_solvers.pyandtest/gromovpass (593 passed).Checklist